Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP5 and OpenSSL

Posted on 2008-10-23
5
Medium Priority
?
1,562 Views
Last Modified: 2013-12-13
A script that use to work fine doesn't anymore. Now I get the error:
Notice: fopen() [function.fopen]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?

When I do print_r(get_loaded_extensions()); openssl does not appear, but I'm using PHP5, which has openssl included.

I'm using WHM/Cpanel but I can also edit php.ini manually. Any ideas? In php.ini php_openssl.dll is not listed next to "extensions"
0
Comment
Question by:phper
  • 2
5 Comments
 
LVL 6

Expert Comment

by:thebradnetwork
ID: 22788783
Place the following line in your php.ini file.
extension=php_openssl.dll

Open in new window

0
 

Author Comment

by:phper
ID: 22788908
I added that, restarted httpd & sshd, which restarted. But got the same error on the script. Tried to graceful & forceful restarts but got this error both times:

cpsrvd failed @ Thu Oct 23 13:56:00 2008. A restart was attempted automagically.
Failure Reason: Unable to connect to port 2086

Then I restarted httpd & sshd again but the error on the script remains.

When I do print_r(get_loaded_extensions()); openssl still does not appear,
0
 

Author Comment

by:phper
ID: 22789681
From the error_logs

[23-Oct-2008 13:51:06] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_openssl.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
0
 
LVL 3

Accepted Solution

by:
raminhos earned 2000 total points
ID: 22791726
Hello, i made a simple how-to for myself, to use whenever i need.

I couldn't attach my zip file, so i will place here my little how to and the files you require

I need to have php 5 with ssl installed..

If you want i can email you with all the files i use in my mini how to..


BIN:
- libeay32.dll
- openssl
- openssl.exe
- ssleay32.dll

CONF
- ssl.conf

MODULES
- mod_ssl.so



Install SSL in Apache

Copy the following files to apache/bin directory
libeay32.dll
openssl.cnf
openssl.exe
ssleay32.dll


Copy the ssl.conf file to apache/conf directory
Create a folder named ssl inside apache/conf


Copy the file mod_ssl.so to folder apache/modules

Now, lets generate certeficate and keys

Inside the folder bin of apache in commando prompt:

Check the key: ServerName in httpd.conf so we can fill the CN in the certeficate creation

openssl req -config openssl.cnf -new -out nome_servidor.csr
openssl rsa -in privkey.pem -out nome_servidor.key
openssl x509 -in nome_servidor.csr -out nome_servidor.cert -req -signkey nome_servidor.key -days 1095


Now that we have the certs and keys, lets move the .cert and .key files to apache/conf/ssl


Edit httpd.conf file and change:

- uncomment: LoadModule rewrite_module modules/mod_rewrite.so


Add:

Include conf/ssl.conf
LoadModule ssl_module modules/mod_ssl.so


Edit ssl.conf and change the following directives with the both names generated (.key and .cert)

SSLCertificateFile
SSLCertificateKeyFile



If you want to force http to redirect to https:

Place the following inside httpd.conf:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question