468,107 Members | 1,365 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

openssl extension not loading (need to open https stream)

I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC
(Windows XP). One of the scripts that I run daily needs to access a
secure URL (https://..............). When I am running Php4, it can
open the file.

However, when I run Php5 I (now) get this error message:
"Unable to find the wrapper "https" - did you forget to enable it when
you configured PHP?"

This is new. Last time I messed with this, I merely got:
"failed to open stream: Invalid argument"

I can see in phpinfo that the only registered streams are:
php, file, data, http, ftp, compress.zlib

I need https and ftps to be in that list, too.

Today I made the php.ini files for Php4 and Php5 nearly identical (the
only difference being the locations of some directories (extensions and
tmp). I downloaded the latest Windows binary from Php.net (5.2.5) and
installed (unzipped) it on my computer and am testing with that. I have
libeay32.dll and ssleay32.dll installed in the Windows System32 folder
(Where they need to be - in the executable Path. That's why Php4
works). I have also enabled the openssl extension and made sure it is
in the extension folder ("php5.2.5/ext").

When I run a script with
echo '<pre>';
print_r(stream_get_wrappers());
echo '</pre>';

echo '<pre>';
print_r(get_loaded_extensions());
echo '</pre>';

I get:

Array
(
[0] =php
[1] =file
[2] =data
[3] =http
[4] =ftp
[5] =compress.zlib
)

Array
(
[0] =bcmath
[1] =calendar
[2] =com_dotnet
[3] =ctype
[4] =session
[5] =filter
[6] =ftp
[7] =hash
[8] =iconv
[9] =json
[10] =odbc
[11] =pcre
[12] =Reflection
[13] =date
[14] =libxml
[15] =standard
[16] =tokenizer
[17] =zlib
[18] =SimpleXML
[19] =dom
[20] =SPL
[21] =wddx
[22] =xml
[23] =xmlreader
[24] =xmlwriter
[25] =apache2handler
[26] =curl
[27] =mbstring
[28] =exif
[29] =gd
[30] =mhash
[31] =printer
No openssl. (??) I was getting an error logged about the
php_printer.dll not being found, but after I put it in the extension
folder, it then showed up in the above list. And now the error log is
empty.

Another new thing I noticed today is that If I run Php.exe (from the
root folder of php5.2.5) and execute the above file, I get this
(abbreviated):
....
[25] =curl
[26] =mbstring
[27] =exif
[28] =gd
[29] =mhash
[30] =openssl
[31] =printer

So run from the command line, I can see that openssl is loaded ... and,
in fact, I can execute my script that access the secure URL (https:)
successfully.

Executing "php -i" even shows me:
Registered PHP Streams =php, file, data, http, ftp, compress.zlib,
https, ftps

So now I seem to be getting somewhere. What I don't understand is why
the apache module (which is how I always run Php - php5apache2.dll)
does not load the openssl extension. It doesn't even give me an error
message about it. It simply is not loaded. Why does the command line
load the extension, but not the Apache module? (The command line and
module use the same php.ini file. That's how they both loaded the
printer extension).

I would really like to move on and put Php4 behind me, but this
roadblock has been in my way for over a year now.

Any ideas what's wrong, or what I need to try? (I believe the problem
is simply that the openssl extension does not load successfully ... but
without errors?)

Thanks in Advance for any help.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Mar 12 '08 #1
5 7455
if ur pb can't be solved by changing php.ini
take a look at the "httpd.conf" file.

Some extensions may appear as activated in phpinfo() or in command line, but
not being really started.

You can also take a look at apache.logs if you find it...
Mar 12 '08 #2
Hello,
same proble today! Solved!

Look to your error.txt file in log directory if your Apache.

Probably there would be something like:

Unable to load php_openssl.dll...

So extension for ssl is not loaded.

According this http://php.net/manual/en/ref.openssl.php#79441 I found
libeay32.dll and ssleay32.dll in my Apache2/bin folder.

When I replaced them with those files bundled with php it starts to
work!
Enjoy!

VS
On Mar 12, 6:30 am, Chuck Anderson <websiteaddr...@seemy.sigwrote:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC
(Windows XP). One of the scripts that I run daily needs to access a
secure URL (https://..............). When I am running Php4, it can
open the file.

However, when I run Php5 I (now) get this error message:
"Unable to find the wrapper "https" - did you forget to enable it when
you configured PHP?"

This is new. Last time I messed with this, I merely got:
"failed to open stream: Invalid argument"

I can see in phpinfo that the only registered streams are:
php, file, data, http, ftp, compress.zlib

I need https and ftps to be in that list, too.

Today I made the php.ini files for Php4 and Php5 nearly identical (the
only difference being the locations of some directories (extensions and
tmp). I downloaded the latest Windows binary from Php.net (5.2.5) and
installed (unzipped) it on my computer and am testing with that. I have
libeay32.dll and ssleay32.dll installed in the Windows System32 folder
(Where they need to be - in the executable Path. That's why Php4
works). I have also enabled the openssl extension and made sure it is
in the extension folder ("php5.2.5/ext").

When I run a script with
echo '<pre>';
print_r(stream_get_wrappers());
echo '</pre>';

echo '<pre>';
print_r(get_loaded_extensions());
echo '</pre>';

I get:

Array
(
[0] =php
[1] =file
[2] =data
[3] =http
[4] =ftp
[5] =compress.zlib
)

Array
(
[0] =bcmath
[1] =calendar
[2] =com_dotnet
[3] =ctype
[4] =session
[5] =filter
[6] =ftp
[7] =hash
[8] =iconv
[9] =json
[10] =odbc
[11] =pcre
[12] =Reflection
[13] =date
[14] =libxml
[15] =standard
[16] =tokenizer
[17] =zlib
[18] =SimpleXML
[19] =dom
[20] =SPL
[21] =wddx
[22] =xml
[23] =xmlreader
[24] =xmlwriter
[25] =apache2handler
[26] =curl
[27] =mbstring
[28] =exif
[29] =gd
[30] =mhash
[31] =printer

No openssl. (??) I was getting an error logged about the
php_printer.dll not being found, but after I put it in the extension
folder, it then showed up in the above list. And now the error log is
empty.

Another new thing I noticed today is that If I run Php.exe (from the
root folder of php5.2.5) and execute the above file, I get this
(abbreviated):
....
[25] =curl
[26] =mbstring
[27] =exif
[28] =gd
[29] =mhash
[30] =openssl
[31] =printer

So run from the command line, I can see that openssl is loaded ... and,
in fact, I can execute my script that access the secure URL (https:)
successfully.

Executing "php -i" even shows me:
Registered PHP Streams =php, file, data, http, ftp, compress.zlib,
https, ftps

So now I seem to be getting somewhere. What I don't understand is why
the apache module (which is how I always run Php - php5apache2.dll)
does not load the openssl extension. It doesn't even give me an error
message about it. It simply is not loaded. Why does the command line
load the extension, but not the Apache module? (The command line and
module use the same php.ini file. That's how they both loaded the
printer extension).

I would really like to move on and put Php4 behind me, but this
roadblock has been in my way for over a year now.

Any ideas what's wrong, or what I need to try? (I believe the problem
is simply that the openssl extension does not load successfully ... but
without errors?)

Thanks in Advance for any help.

--
*****************************
Chuck Anderson * Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************
Mar 12 '08 #3
Václav Stoupa wrote:
On Mar 12, 6:30 am, Chuck Anderson <websiteaddr...@seemy.sigwrote:
>I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC
(Windows XP). One of the scripts that I run daily needs to access a
secure URL (https://..............). When I am running Php4, it can
open the file.

However, when I run Php5 I (now) get this error message:
"Unable to find the wrapper "https" - did you forget to enable it when
you configured PHP?"

This is new. Last time I messed with this, I merely got:
"failed to open stream: Invalid argument"

I can see in phpinfo that the only registered streams are:
php, file, data, http, ftp, compress.zlib

I need https and ftps to be in that list, too.

Today I made the php.ini files for Php4 and Php5 nearly identical (the
only difference being the locations of some directories (extensions and
tmp). I downloaded the latest Windows binary from Php.net (5.2.5) and
installed (unzipped) it on my computer and am testing with that. I have
libeay32.dll and ssleay32.dll installed in the Windows System32 folder
(Where they need to be - in the executable Path. That's why Php4
works). I have also enabled the openssl extension and made sure it is
in the extension folder ("php5.2.5/ext").

When I run a script with
echo '<pre>';
print_r(stream_get_wrappers());
echo '</pre>';

echo '<pre>';
print_r(get_loaded_extensions());
echo '</pre>';

I get:

Array
(
[0] =php
[1] =file
[2] =data
[3] =http
[4] =ftp
[5] =compress.zlib
)

Array
(
[0] =bcmath
[1] =calendar
[2] =com_dotnet
[3] =ctype
[4] =session
[5] =filter
[6] =ftp
[7] =hash
[8] =iconv
[9] =json
[10] =odbc
[11] =pcre
[12] =Reflection
[13] =date
[14] =libxml
[15] =standard
[16] =tokenizer
[17] =zlib
[18] =SimpleXML
[19] =dom
[20] =SPL
[21] =wddx
[22] =xml
[23] =xmlreader
[24] =xmlwriter
[25] =apache2handler
[26] =curl
[27] =mbstring
[28] =exif
[29] =gd
[30] =mhash
[31] =printer

No openssl. (??) I was getting an error logged about the
php_printer.dll not being found, but after I put it in the extension
folder, it then showed up in the above list. And now the error log is
empty.

Another new thing I noticed today is that If I run Php.exe (from the
root folder of php5.2.5) and execute the above file, I get this
(abbreviated):
....
[25] =curl
[26] =mbstring
[27] =exif
[28] =gd
[29] =mhash
[30] =openssl
[31] =printer

So run from the command line, I can see that openssl is loaded ... and,
in fact, I can execute my script that access the secure URL (https:)
successfully.

Executing "php -i" even shows me:
Registered PHP Streams =php, file, data, http, ftp, compress.zlib,
https, ftps

So now I seem to be getting somewhere. What I don't understand is why
the apache module (which is how I always run Php - php5apache2.dll)
does not load the openssl extension. It doesn't even give me an error
message about it. It simply is not loaded. Why does the command line
load the extension, but not the Apache module? (The command line and
module use the same php.ini file. That's how they both loaded the
printer extension).

I would really like to move on and put Php4 behind me, but this
roadblock has been in my way for over a year now.

Any ideas what's wrong, or what I need to try? (I believe the problem
is simply that the openssl extension does not load successfully ... but
without errors?)

Thanks in Advance for any help.

Hello,
same proble today! Solved!

Look to your error.txt file in log directory if your Apache.

Probably there would be something like:

Unable to load php_openssl.dll...

So extension for ssl is not loaded.
You got it, ... thanks. I am mighty pleased at the coincidence.

Although, I must point out that the error was not in Apache's error log,
rather in Php's error log - in the Php folder (error logging must be
enabled in php.ini). Every time I restarted Apache, I would get this
error in the php error log file (twice, just like this):

[12-Mar-2008 20:08:29] PHP Warning: PHP Startup: Unable to load dynamic
library 'C:\Php5.2.5\ext\php_openssl.dll' - The operating system cannot
run %1.
in Unknown on line 0
[12-Mar-2008 20:08:31] PHP Warning: PHP Startup: Unable to load dynamic
library 'C:\Php5.2.5\ext\php_openssl.dll' - The operating system cannot
run %1.
in Unknown on line 0
According this http://php.net/manual/en/ref.openssl.php#79441 I found
libeay32.dll and ssleay32.dll in my Apache2/bin folder.
When I replaced them with those files bundled with php it starts to
work!
Yes! When I copied libeay32.dll and ssleay32.dll from the Php folder to
apache/bin, overwriting the ones already there (I have Apache with
OpenSSL, and that must be why the other older ones were there), it
finally started working!!

Good grief. I've been at this for a year and a half .... or more. I had
placed those files in the php folder and in windows/system32 .... but
hadn't tried that yet. I can finally retire Php4 from my home PC.
Enjoy!
Thank you! Thank you! Thank you!!! I wish I could buy you (... and me) a
liter of Budvar!

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Mar 13 '08 #4
One minor correction:

Chuck Anderson wrote:
Václav Stoupa wrote:

>On Mar 12, 6:30 am, Chuck Anderson <websiteaddr...@seemy.sigwrote:

>>I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC
(Windows XP). One of the scripts that I run daily needs to access a
secure URL (https://..............). When I am running Php4, it can
open the file.
.... snip
>Hello,
same proble today! Solved!

Look to your error.txt file in log directory if your Apache.

Probably there would be something like:

Unable to load php_openssl.dll...

So extension for ssl is not loaded.


You got it, ... thanks. I am mighty pleased at the coincidence.

Although, I must point out that the error was not in Apache's error log,
rather in Php's error log - in the Php folder (error logging must be
enabled in php.ini). Every time I restarted Apache, I would get this
error in the php error log file (twice, just like this):
Okay. A slight error there on my part. The error *was* in the php
error log, but the php error log was in the apache folder, not in the
Php folder.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Mar 13 '08 #5
Thanks for your gratefulness.
This problem was my headache in my new job (soap connection through
https)

You could arrive to our php conference on 12th April in Czech
Republic. I'm organize it. And buy me one of the hundred type of bears
we have in our country ;-) Besides the programmer's pub the main
program will be lectures about PRADO, Zend 1.5, Doctrine ORM and
Nette.

One small problem is you probably dont't speak czech :-(
The conference description is here:
http://blog.php-group.cz/2008/02/20/...rky-jaro-2008/
So you have one month to learn language ;-D
Maybe you don't know what Nette is. I provide small description of it
because it's hidden diamond whithin the php developer's tools. It is
outcome of what was called in past centuries as "golden czech hands"
about cleverness of czech work-people. So, it's stunning new
innovative php framework from David Grudl - author of popular text
markup language [http://texy.info] and very powerfull and small
database abstraction layer [http://dibiphp.com]). Nette is based on
components and commands .Framework includes many very useful libraries
which haven't been in other frameworks yet. Safe file saving from php
web aplication, nice debugging, proper hierarchy of exceptions, two-
way router, controls in templates and easy composing of urls through
linked pages without much effort, form library was ready before
Zend_Form etc. Url is [http://nettephp.com] There is sentence say
something like "Content will be here very soon" - I think before the
date of conference starts. So check this in month again if you are
interested in.

Wish you best!
Buy sorry bye :-)

VS

On Mar 13, 3:50 am, Chuck Anderson <websiteaddr...@seemy.sigwrote:
Václav Stoupa wrote:
On Mar 12, 6:30 am, Chuck Anderson <websiteaddr...@seemy.sigwrote:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC
(Windows XP). One of the scripts that I run daily needs to access a
secure URL (https://..............). When I am running Php4, it can
open the file.
However, when I run Php5 I (now) get this error message:
"Unable to find the wrapper "https" - did you forget to enable it when
you configured PHP?"
This is new. Last time I messed with this, I merely got:
"failed to open stream: Invalid argument"
I can see in phpinfo that the only registered streams are:
php, file, data, http, ftp, compress.zlib
I need https and ftps to be in that list, too.
Today I made the php.ini files for Php4 and Php5 nearly identical (the
only difference being the locations of some directories (extensions and
tmp). I downloaded the latest Windows binary from Php.net (5.2.5) and
installed (unzipped) it on my computer and am testing with that. I have
libeay32.dll and ssleay32.dll installed in the Windows System32 folder
(Where they need to be - in the executable Path. That's why Php4
works). I have also enabled the openssl extension and made sure it is
in the extension folder ("php5.2.5/ext").
When I run a script with
echo '<pre>';
print_r(stream_get_wrappers());
echo '</pre>';
echo '<pre>';
print_r(get_loaded_extensions());
echo '</pre>';
I get:
Array
(
[0] =php
[1] =file
[2] =data
[3] =http
[4] =ftp
[5] =compress.zlib
)
Array
(
[0] =bcmath
[1] =calendar
[2] =com_dotnet
[3] =ctype
[4] =session
[5] =filter
[6] =ftp
[7] =hash
[8] =iconv
[9] =json
[10] =odbc
[11] =pcre
[12] =Reflection
[13] =date
[14] =libxml
[15] =standard
[16] =tokenizer
[17] =zlib
[18] =SimpleXML
[19] =dom
[20] =SPL
[21] =wddx
[22] =xml
[23] =xmlreader
[24] =xmlwriter
[25] =apache2handler
[26] =curl
[27] =mbstring
[28] =exif
[29] =gd
[30] =mhash
[31] =printer
No openssl. (??) I was getting an error logged about the
php_printer.dll not being found, but after I put it in the extension
folder, it then showed up in the above list. And now the error log is
empty.
Another new thing I noticed today is that If I run Php.exe (from the
root folder of php5.2.5) and execute the above file, I get this
(abbreviated):
....
[25] =curl
[26] =mbstring
[27] =exif
[28] =gd
[29] =mhash
[30] =openssl
[31] =printer
So run from the command line, I can see that openssl is loaded ... and,
in fact, I can execute my script that access the secure URL (https:)
successfully.
Executing "php -i" even shows me:
Registered PHP Streams =php, file, data, http, ftp, compress.zlib,
https, ftps
So now I seem to be getting somewhere. What I don't understand is why
the apache module (which is how I always run Php - php5apache2.dll)
does not load the openssl extension. It doesn't even give me an error
message about it. It simply is not loaded. Why does the command line
load the extension, but not the Apache module? (The command line and
module use the same php.ini file. That's how they both loaded the
printer extension).
I would really like to move on and put Php4 behind me, but this
roadblock has been in my way for over a year now.
Any ideas what's wrong, or what I need to try? (I believe the problem
is simply that the openssl extension does not load successfully ... but
without errors?)
Thanks in Advance for any help.
Hello,
same proble today! Solved!
Look to your error.txt file in log directory if your Apache.
Probably there would be something like:
Unable to load php_openssl.dll...
So extension for ssl is not loaded.

You got it, ... thanks. I am mighty pleased at the coincidence.

Although, I must point out that the error was not in Apache's error log,
rather in Php's error log - in the Php folder (error logging must be
enabled in php.ini). Every time I restarted Apache, I would get this
error in the php error log file (twice, just like this):

[12-Mar-2008 20:08:29] PHP Warning: PHP Startup: Unable to load dynamic
library 'C:\Php5.2.5\ext\php_openssl.dll' - The operating system cannot
run %1.
in Unknown on line 0
[12-Mar-2008 20:08:31] PHP Warning: PHP Startup: Unable to load dynamic
library 'C:\Php5.2.5\ext\php_openssl.dll' - The operating system cannot
run %1.
in Unknown on line 0
According thishttp://php.net/manual/en/ref.openssl.php#79441I found
libeay32.dll and ssleay32.dll in my Apache2/bin folder.
When I replaced them with those files bundled with php it starts to
work!

Yes! When I copied libeay32.dll and ssleay32.dll from the Php folder to
apache/bin, overwriting the ones already there (I have Apache with
OpenSSL, and that must be why the other older ones were there), it
finally started working!!

Good grief. I've been at this for a year and a half .... or more. I had
placed those files in the php folder and in windows/system32 .... but
hadn't tried that yet. I can finally retire Php4 from my home PC.
Enjoy!

Thank you! Thank you! Thank you!!! I wish I could buy you (... and me) a
liter of Budvar!

--
*****************************
Chuck Anderson * Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************
Mar 13 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Brad Kent | last post: by
3 posts views Thread by Chris Fortune | last post: by
reply views Thread by bozzzza | last post: by
1 post views Thread by Skeleton Man | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.