在Apache 2.4/PHP 7.4.4中禁用了OpenSSL支持 [英] OpenSSL Support disabled in Apache 2.4/PHP 7.4.4

查看:221
本文介绍了在Apache 2.4/PHP 7.4.4中禁用了OpenSSL支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试手动设置Apache MariaDB PHP,但遇到了openssl功能的一些问题.这是我设置Apache 2.4和PHP 7.4.4的步骤:

I.Apache httpd安装和配置

  1. 下载并提取

    根据"

    然后将显示一个openssl部分:

    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

    1. Download and Extract httpd-2.4.43-win64-VS16.zip from apachelounge to "D:\Programs-64Bit\Apache24"
    2. Set ServerRoot in httpd.conf with full path
    3. Set ServerName to localhost:80
    4. Define WWWROOT with desired DocumentRoot path in httpd.conf (i.e. Define WWWROOT "E:/Programs/WWW")
    5. Set DocumentRoot and <Directory> values to "${WWWROOT}"

    II. Combining PHP with apache

    1. Download and Extract Thread Safe php-7.4.4-Win32-vc15-x64.zip to "D:\Programs-64Bit\PHP\PHP7.4.4-64Bit"
    2. Add the following lines at the end of httpd.conf:

    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"
    

    1. Copy and rename php.ini-development to the same php root directory as php.ini
    2. set extension_dir and enable every single extension except oci8_12c, pdo_firebird, pdo_oci and snmp

    III. Testing PHP with Apache

    1. Create a php file (index.php) with the following code:

    <?php 
         phpinfo();
    ?>
    

    1. run httpd.exe

    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?

    解决方案

    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:

    这篇关于在Apache 2.4/PHP 7.4.4中禁用了OpenSSL支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆