Apache2.4 + php7.1.12

系统:64位 win10

1,首先 https://www.apachelounge.com/download/ 下载:Apache 2.4.29 Win64

2,http://windows.php.net/download/ 下载:VC14 x64 Thread Safe(含apache_dll)

  http://windows.php.net/downloads/releases/php-7.1.12-Win32-VC14-x64.zip

3,复制 php.ini-development 改为 php.ini

4,修改 php.ini 配置:

extension_dir = "E:/server/php/ext"
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
date.timezone = PRC

5,修改 apache 配置

ServerRoot "E:/server/Apache24"
ServerName localhost

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    Satisfy all
</Directory>

DocumentRoot "E:/server/Apache24/htdocs"
<Directory "E:/server/Apache24/htdocs">
    AllowOverride All
    Order allow,deny
    Allow from all

Include conf/extra/httpd-vhosts.conf

ScriptAlias /cgi-bin/ "E:/server/Apache24/cgi-bin/"
<Directory "E:/server/Apache24/cgi-bin">

6,在 Apache24/conf/httpd.conf 配置文件最后加上对php7的支持

#php7 support
LoadModule php7_module E:/server/php/php7apache2_4.dll
AddType application/x-httpd-php .php .html .htm
# configure the path to php.ini
PHPIniDir "E:/server/php"

7, 以管理员身份运行 cmd 安装 apche2.4 服务(要添加 /d 开关切换目录)

C:\WINDOWS\system32>cd E:\server\Apache24\bin

C:\WINDOWS\system32>cd /d E:\server\Apache24\bin

E:\server\Apache24\bin>httpd.exe -k install
Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....

8,配置项目

<VirtualHost *:8000>
    DocumentRoot "E:/server/web/root/public"
#    ServerName localhost
    CustomLog "logs/root.com-access.log" common
    ErrorLog  "logs/root.com-error.log"
</VirtualHost>

9,E:\server\Apache24\bin\ApacheMonitor 启动服务

10,访问 http://127.0.0.1:8000 报错在verdor/framework/src/Illuminate/Encryption/Encrtpter.php的84行,找不到openssl_cipher_iv_length()函数。

  解决:将php目录下的libeay32.dll和ssleay32.dll拷贝到Apache24目录的bin目录下。

 

posted on 2017-12-16 17:44  风小可  阅读(334)  评论(0编辑  收藏  举报