Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
April 02, 2014 PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Brad Roberts is trying to switch bugzilla to use https, which breaks https://github.com/D-Programming-Language/dlang.org/blob/master/fetch-issue-cnt.php. He's not a PHP guy so he wouldn't know how to fix it. Could I trust one of our contributors to take on this task? Thanks, Andrei |
April 02, 2014 Re: PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu wrote:
> Brad Roberts is trying to switch bugzilla to use https, which breaks https://github.com/D-Programming-Language/dlang.org/blob/master/fetch-issue-cnt.php. He's not a PHP guy so he wouldn't know how to fix it. Could I trust one of our contributors to take on this task?
>
> Thanks,
>
> Andrei
The code is fine as is. The problem is PHP needs to be built with SSL support and the php installation on dlang.org wasn't. The only person who can fix this is Jan, I believe.
The error message it gave until I switched it back to http was:
"Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"
|
April 02, 2014 Re: PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 4/2/14, 1:28 PM, Andrei Alexandrescu wrote: > Brad Roberts is trying to switch bugzilla to use https, which breaks > https://github.com/D-Programming-Language/dlang.org/blob/master/fetch-issue-cnt.php. He's not a PHP > guy so he wouldn't know how to fix it. Could I trust one of our contributors to take on this task? > > Thanks, > > Andrei I pointed you to a url that contains a couple excellent answers this morning: http://stackoverflow.com/questions/1975461/file-get-contents-with-https From that page, the primary problem is the php install on dlang.org's webserver lacks either configuration or a php extension and it's configuration: Add this to the php config file: extension=php_openssl.dll allow_url_fopen = On Alternately, if the curl extension is installed, it looks like this code would be an alternative implementation: function getSslPage($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); return $result; } But the community doesn't have access to the server, so the best anyone external can do is provide this sort of data or setup an external proxy server, which is a horrible solution. |
April 02, 2014 Re: PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | On Wed, 02 Apr 2014 15:32:24 -0500, Brad Anderson <eco@gnuk.net> wrote:
> On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu wrote:
>> Brad Roberts is trying to switch bugzilla to use https, which breaks https://github.com/D-Programming-Language/dlang.org/blob/master/fetch-issue-cnt.php. He's not a PHP guy so he wouldn't know how to fix it. Could I trust one of our contributors to take on this task?
>>
>> Thanks,
>>
>> Andrei
>
> The code is fine as is. The problem is PHP needs to be built with SSL support and the php installation on dlang.org wasn't. The only person who can fix this is Jan, I believe.
>
> The error message it gave until I switched it back to http was:
>
> "Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"
Specifically, you need to enable the OpenSSL plugin, if you're using a copy of php installed from a package manager, it is typically in a separate package, and, depending on the distro, will enable itself when you install it. Once that is enabled, the code will work perfectly.
|
April 03, 2014 Re: PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 2 April 2014 at 20:28:07 UTC, Andrei Alexandrescu wrote: > Brad Roberts is trying to switch bugzilla to use https, which breaks https://github.com/D-Programming-Language/dlang.org/blob/master/fetch-issue-cnt.php. He's not a PHP guy so he wouldn't know how to fix it. Could I trust one of our contributors to take on this task? More discussion here: https://d.puremagic.com/issues/show_bug.cgi?id=12459 |
April 04, 2014 Re: PHP: fetch an URL via SSL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | Just noticed: on the index page for digitalmars.D.bugs in section "Also via" link to bugzilla leads to unencrypted site. |
Copyright © 1999-2021 by the D Language Foundation