apache配置php后无法启动,apache中配置php后,无法启动php

php的版本是:5.2.17

配置文件代码:

LoadModule php5_module d:/php/php5apache2_2.dll

AddType application/x-httpd-php.php

PHPIniDir "d:/php"

下载的是压缩包,安装在d:/php

出现状况:the requested operation has failed

怎么解决呢?

回复讨论(解决方案)

查看一下apache日志

你安装apache的目录\Apache\logs\error.log

日志内容

Asynchronous AcceptEx failed.

[Mon May 20 13:15:20 2013] [notice] Child 3328:

Released the start mutex

[Mon May 20 13:15:21 2013] [notice] Child 3328: All

worker threads have exited.

[Mon May 20 13:15:21 2013] [notice] Child 3328: Child

process is exiting

[Mon May 20 13:21:11 2013] [warn] pid file

C:/Program Files (x86)/Apache

Group/Apache2/logs/httpd.pid overwritten -- Unclean

shutdown of previous Apache run?

[Mon May 20 13:21:11 2013] [notice] Apache/2.0.64

(Win32) configured -- resuming normal operations

[Mon May 20 13:21:11 2013] [notice] Server built: Oct

18 2010 01:36:23

[Mon May 20 13:21:11 2013] [notice] Parent: Created

child process 1696

[Mon May 20 13:21:11 2013] [notice] Child 1696: Child

process is running

[Mon May 20 13:21:11 2013] [notice] Child 1696:

Acquired the start mutex.

[Mon May 20 13:21:11 2013] [notice] Child 1696:

Starting 250 worker threads.

[Mon May 20 13:21:29 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/feng.html

[Mon May 20 13:21:30 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/feng.html

[Mon May 20 13:21:52 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/febo

[Mon May 20 13:21:56 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/febo

[Mon May 20 13:21:57 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/febo

[Mon May 20 13:22:52 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/\xe9\xa3\x8e

\xe5\xb8\xae\xe7\xbd\x91, referer: http://localhost/

[Mon May 20 13:22:54 2013] [error] [client 127.0.0.1]

File does not exist: E:/web/myweb/\xe9\xa3\x8e

\xe5\xb8\xae\xe7\xbd\x91, referer: http://localhost/

[Mon May 20 13:51:37 2013] [notice] Parent: Received

restart signal -- Restarting the server.

[Mon May 20 13:51:37 2013] [notice] Child 1696: Exit

event signaled. Child process is ending.

[Mon May 20 13:51:37 2013] [crit] Apache is running a

threaded MPM, but your PHP Module is not compiled

to be threadsafe. You need to recompile PHP.

Pre-configuration failed

[Mon May 20 13:51:37 2013] [warn] (OS 995)由于线程退

出或应用程序请求,已中止 I/O 操作。 : winnt_accept:

Asynchronous AcceptEx failed.

[Mon May 20 13:51:38 2013] [notice] Child 1696:

Released the start mutex

[Mon May 20 13:51:39 2013] [notice] Child 1696: All

worker threads have exited.

[Mon May 20 13:51:39 2013] [notice] Child 1696: Child

process is exiting

Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.

Pre-configuration failed

主要是这句,参考一下:

http://blog.csdn.net/abandonship/article/details/7344918

我换了php-5.2.17-Win32-VC6-x86这个版本,然后按照博客上的步骤安装,为什么还是安装不成功,

不明白下边这句怎么改,是在文件中查找吗?

2. 打开php.ini文件:(添加或打开)

extension_dir = "PHP安装目录\ext"

default_charset = "gbk"

extension=php_mysql.dll

希望给予更加详细的介绍

新手的话建议你安装个wamp,特别好用,我就是新手。

是的,要打开php.ini文件,修改。

extension_dir 应该不需要修改,默认安装时已经设置

default_charset可以换成你需要的。

extension则是找到你想要的,删掉前面的分号;

修改完保存并重启apache(管理工具->服务 找到apache2)。

你所说的“安装不成功”是指什么现象?

我按照韩顺平php视频特意安装了下,安装成功后,对照了下楼主的安装情况,指出不一样。

1.apache 的配置文件,httpd.conf,韩顺平老师配置这么进行配置的(可忽略路径的不同);

PHPIniDir "F:/ampserver/php"

LoadModule php5_module f:/ampserver/php/php5apache2_2.dll

SetHandler application/x-httpd-php

2.接下来,我们要进行的是php的安装。php解压缩后,并没有php.ini这个文件,你所要做的,是要将php.ini-production修改成php.ini(这步是不是没做?).

3.在apache的htdoc文件里,你最好放置一个文件可命名为info.php 该文件就是

我按照韩顺平php视频特意安装了下,安装成功后,对照了下楼主的安装情况,指出不一样。

1.apache 的配置文件,httpd.conf,韩顺平老师配置这么进行配置的(可忽略路径的不同);

PHPIniDir "F:/ampserver/php"

LoadModule php5_module f:/ampserver/php/php5apache2_2.dll

SetHandler application/x-httpd-php

2.接下来,我们要进行的是php的安装。php解压缩后,并没有php.ini这个文件,你所要做的,是要将php.ini-production修改成php.ini(这步是不是没做?).

3.在apache的htdoc文件里,你最好放置一个文件可命名为info.php 该文件就是

不错,看看看啊

还是无法启动,点击start出现对话框:

the requested has failed

我的安装过程:

1.php-5.2.17-Win32-VC6-x86下载完之后解压到d:/php,然后把php.ini-recommended这个文件重命名为php.ini,然后对php.ini进行配置:

extension_dir = "d:\php\ext"

default_charset = "gbk"

extension=php_mysql.dll这句把前面的分号删除;复制php5ts.dll到c:\windows\system32;

2.接着进行httpd.conf的配置,配置文件如下:

PHPIniDir "d:/php"

LoadModule php5_module d:/php/php5apache2_2.dll

AddType application/x-httpd-php.php

配置文件加在#LoadModule ssl_module modules/mod_ssl.so这句的下面。

3.查看logs中的errors.log错误原因是:

Syntax error on line 174 of C:/Program Files (x86)/Apache Group/Apache2/conf/httpd.conf:

Cannot load D:/php/php5apache2_2.dll into server:

也就是说无法连接到d盘中的php文件,这是怎么回事,就是安装在d:/php中。

怎么解决呢?

apache的版本是2.0.64

那你就看看 D:/php/php5apache2_2.dll 这个文件是否存在

如果存在,就检查一下是否有执行权

Apache is running a

threaded MPM, but your PHP Module is not compiled

to be threadsafe. You need to recompile PHP.

你的APACHE是线程安全的 PHP不是

我装了个wamp

谢谢大家的帮忙,等到以后学到一定程度在自己配置吧

x-httpd-php.php 改为x-httpd-php .php 空格啊

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值