欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php的wamp环境搭建问题

程序员文章站 2022-04-11 14:51:45
...
Apache php安装配置好后,目前mysql还没有安装,开启Apache时,弹出两次warning PHP Startup警告后Apache开启。
本机是通过路由器和光纤猫连接网线上网,Windows XP操作系统。

Apache httpd.conf文件配置是:

Listen 12.34.56.78:80

Listen 80

LoadModule php5_module D:/wamp/php/php5apache2_4.dll
PHPIniDir D:/wamp/php

ServerName localhost:80

AddType application/x-httpd-php .php

php.ini文件配置:

extension_dir = "D:/wamp/php/ext"

extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll
extension=php_soap.dll
extension=php_sockets.dll

date.timezone =Asia/Shanghai

Apache错误日志:
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.x.x. Set the 'ServerName' directive globally to suppress this message
PHP Warning: PHP Startup: in Unknown on line 0
[Thu Oct 15 10:48:13.312500 2015] [mpm_winnt:notice] [pid 4044:tid 1668] AH00354: Child: Starting 64 worker threads.

将所有dll都注册了一遍,还是那样。

请各位老师指教到底哪里有错误?谢谢!

回复内容:

Apache php安装配置好后,目前mysql还没有安装,开启Apache时,弹出两次warning PHP Startup警告后Apache开启。
本机是通过路由器和光纤猫连接网线上网,Windows XP操作系统。

Apache httpd.conf文件配置是:

Listen 12.34.56.78:80

Listen 80

LoadModule php5_module D:/wamp/php/php5apache2_4.dll
PHPIniDir D:/wamp/php

ServerName localhost:80

AddType application/x-httpd-php .php

php.ini文件配置:

extension_dir = "D:/wamp/php/ext"

extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll
extension=php_soap.dll
extension=php_sockets.dll

date.timezone =Asia/Shanghai

Apache错误日志:
AH00558: httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.x.x. Set the 'ServerName' directive globally to suppress this message
PHP Warning: PHP Startup: in Unknown on line 0
[Thu Oct 15 10:48:13.312500 2015] [mpm_winnt:notice] [pid 4044:tid 1668] AH00354: Child: Starting 64 worker threads.

将所有dll都注册了一遍,还是那样。

请各位老师指教到底哪里有错误?谢谢!

逐一关闭php扩展,发现是php_curl加载时报错,而且phpinfo()中curl没有加载上
解决办法:
第一种方法:将php安装目录下的libeay32.dll,libssh2.dll,php5ts.dll,php_curl.dll,ssleay32.dll 复制到system32目录下

第二种方法:在httpd.conf 中加载如下依赖文件

LoadFile D:/wamp/php/php5ts.dll

LoadFile D:/wamp/php/libeay32.dll

LoadFile D:/wamp/php/ssleay32.dll

LoadFile D:/wamp/php/libssh2.dll

这样配置后,Apache开启时不再弹出warning PHP Startup:

第一个警报可以用 ServerName 127.0.0.1 解决

相关标签: php