I'm trying to setup Apache MariaDB PHP manually but I'm running into some issues with the openssl feature. Here are the steps I took to setup Apache 2.4 and PHP 7.4.4:
I. Apache httpd Installation and configuration
ServerRoot in httpd.conf with full pathServerName to localhost:80WWWROOT with desired DocumentRoot path in httpd.conf (i.e. Define WWWROOT "E:/Programs/WWW")DocumentRoot and <Directory> values to "${WWWROOT}"II. Combining PHP with apache
Define PHPROOT "D:/Programs-64Bit/PHP/PHP7.4.4-64Bit" LoadModule php7_module "${PHPROOT}/php7apache2_4.dll" AddType application/x-httpd-php .php PHPIniDir "${PHPROOT}" LoadFile "${PHPROOT}/libcrypto-1_1-x64.dll" LoadFile "${PHPROOT}/libssl-1_1-x64.dll" LoadFile "${PHPROOT}/libssh2.dll" LoadFile "${PHPROOT}/nghttp2.dll" LoadFile "${PHPROOT}/php7ts.dll"
III. Testing PHP with Apache
<?php phpinfo(); ?>
This is what it tells me about openssl:
according to "OpenSSL support disabled in Apache/PHP on Windows" on StackOverflow and the last comment in the php.net page "PHP Manual > Function Reference > Cryptography Extensions > OpenSSL > Installing/Configuring" it should be working. what am I doing wrong?
In case anyone's extension=openssl and LoadModule ssl_module modules/mod_ssl.so are both uncommented and still looking for answers, try setting your extension_dir to absolute path; extension_dir = "C:\php\ext".
I've been searching around for hours and that solved it. Thanks to Koichi's answer. Also I didn't need any of those LoadFile lines my httpd.conf.
My environment (for any reference):
If you'd like to enable OpenSSL suport in Phar.
Just uncomment following line.
// php.ini
extension=openssl
This is actually easy to solve. after checking if openssl was enable on PHP in a command prompt with the command php index.php where index.php is the file created in the original post. One can see that openssl is actually enable.
To enable it on Apache2.4, one needs to uncomment LoadModule ssl_module modules/mod_ssl.so in httpd.conf.
The phar section will look like this:
And an openssl section will appear: