在WAMP中使用PHP 7 [英] Using PHP 7 with WAMP

查看:104
本文介绍了在WAMP中使用PHP 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的操作系统是Windows 10 Pro x64,并且已经安装了VC14软件包x86和x64.

My OS is Windows 10 Pro x64 and I have installed VC14 packages x86 and x64.

我已经在wamp/bin/php中添加了一个php7.0.0目录,复制了文件php.iniphpForApache.iniwampserver.conf,并修改了这些文件中的目录和php扩展名.

I have added a php7.0.0 directory to wamp/bin/php, copied files php.ini, phpForApache.ini and wampserver.conf, and modified the directories and php extensions in these files.

有我的wampserver.conf:

<?php
$phpConf['phpIniDir'] = '.';
$phpConf['phpExeDir'] = '.';
$phpConf['phpConfFile'] = 'php.ini';

//PHP 7 needs Apache 2.4.x and doesn't works with Apache 2.2.x
$phpConf['apache']['2.4']['LoadModuleName'] = 'php7_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php7apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] = '';
?>

WAMP可以正确读取它,因为当我选择php7.0.0版本时,Apache httpd.conf会显示以下行:

It is correctly read by WAMP because when I select the php7.0.0 version, the Apache httpd.conf gets this line:

LoadModule php7_module "c:/wamp/bin/php/php7.0.0/php7apache2_4.dll"

路径正确,并且dll文件存在,但是Apache服务无法启动,如果我检查Apache扩展名,则表示未找到php7_module(红色正方形).

The path is correct and the dll file exists, but the Apache service doesn't start and if I check Apache extensions, the php7_module is indicated as not found (red square).

如果我检查apache错误日志,唯一报告的是

If I check apache error log, the only reported one is

[2015年12月8日星期二11:02:14.021018] [core:warn] [pid 5008:tid 516] AH00098:pid文件C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid被覆盖- -不干净地关闭了以前的Apache运行?

[Tue Dec 08 11:02:14.021018 2015] [core:warn] [pid 5008:tid 516] AH00098: pid file C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

在WAMP服务器中成功运行PHP 7的人是否知道针对此问题的修复程序?谢谢.

Does anyone who has successfully run PHP 7 in WAMP server know a fix for this problem? Thank you.

推荐答案

有答案:

我正在使用最后一个官方的wampserver运行,该服务器似乎与php7不兼容(我在4台计算机上进行了一些测试,但结果均与我的问题相同.)

I was running with the last official wampserver which seems to be not compatible with php7 (I have made some tests on 4 computers with the same result of my problem).

我的一位同事给我这个链接: http://forum.wampserver. com/read.php?1,126455 ,其中包含一些教程,可将wampserver更新为非官方的新版本. 按照这种指示,我已经更新了文件夹wamp/scripts和wamp/lang. 之后,该apache通常会使用php 7启动.

One of my colleague give me this link: http://forum.wampserver.com/read.php?1,126455 with some tutorials to update wampserver to unofficial new versions. Following this indications I have updated folders wamp/scripts and wamp/lang. After that apache start normally using php 7.

PS:某些php函数似乎有些错误.另一个解决方法是更新其他wampserver文件,有关详细信息,请参见链接. 但是目前我还没有这个错误.

PS : it seems to be some errors with certain php functions. One more fix is to update some other wampserver files, the details are on the link up. But for the moment I haven't got this errors.

感谢所有访问此页面并为我提供帮助的人.

Thank you to all the people who are coming on this page and giving me some help.

我希望将来其他一些开发人员可以在这里找到答案.

I hope in the future some other developers will found answers here.

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

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