Apache不会从PHP加载模块 [英] Apache doesn't load module from PHP

查看:306
本文介绍了Apache不会从PHP加载模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注这篇葡萄牙语文章,以配置Apache和PHP:

I am following this portuguese article to configure Apache and PHP:

我已经设置了 php.ini httpd.conf 文件.除了 php5apache2_4.dll 还在正确的目录中,但是当我重新启动服务器时,请向我显示以下错误:

I already set up the php.ini and httpd.conf files. Besides to php5apache2_4.dll is in the right directory, but when I restart the server show me the following error:

httpd.exe:D:/Apache24/conf/httpd.conf的第531行的语法错误: 无效的LoadModule路径\ xe2 \ x80 \ xaa"D:/php-5.6.13/php5apache2_4.dll"

httpd.exe: Syntax error on line 531 of D:/Apache24/conf/httpd.conf: Invalid LoadModule path \xe2\x80\xaa"D:/php-5.6.13/php5apache2_4.dll"

Httpd.conf:

Httpd.conf:

LoadModule php5_module ‪"D:/php-5.6.13/php5apache2_4.dll"
AddType application/x-httpd-php .php 
PHPIniDir "D:/php-5.6.13/"

编辑

我更改了 Httpd.conf 文件.

LoadModule php5_module ‪"../php-5.6.13/php5apache2_4.dll"
AddType application/x-httpd-php .php 
PHPIniDir "../php-5.6.13/"

现在返回了一个新错误:

And now is returning me a new error:

httpd.exe:D:/Apache24/conf/httpd.conf的第531行的语法错误: 无法将../php-5.6.13/php5apache2_4.dll加载到服务器:%1 n \ xe3o \ xe9 um aplicativo Win32 v \ xe1lido.

httpd.exe: Syntax error on line 531 of D:/Apache24/conf/httpd.conf: Cannot load ../php-5.6.13/php5apache2_4.dll into server: %1 n\xe3o \xe9 um aplicativo Win32 v\xe1lido.

英语:不是有效的Win32应用程序.

In English language: Not a valid Win32 application.

在控制台中:

php -version
PHP 5.6.13 (cli) (built: Sep  3 2015 15:14:40)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

httpd -version
Server version: Apache/2.4.16 (Win64)
Apache Lounge VC14 Server built:   Jul 22 2015 13:24:19

推荐答案

我只是在尝试配置php7时遇到了同样的问题,所以对于其他有麻烦的人来说:

I just had the same problem trying to configure php7, so for anyone else having trouble:

可能有一些问题.检查您的php和Apache版本是否兼容(都是64位x64或都是32位x86;请注意,从

There may be a few issues. Check that your versions of php and Apache are bit-compatible (both 64-bit x64 or both 32-bit x86; note that when downloading 64-bit PHP from windows.php.net/download/, the zip file will be called php...Win32...x64).

还要检查它们是否都使用相同版本的Visual Studio(例如VC14)进行编译.这恰好是这里的问题: www.apachelounge.com/viewtopic.php?t= 6596

Also check that they are both compiled with the same version of Visual Studio (e.g. VC14). This happened to be the problem here: www.apachelounge.com/viewtopic.php?t=6596

就我而言,我遇到了有关引号的问题 paulsm4 .我从网站复制并粘贴了代码,并注意到当我运行httpd -k start时,我的错误是httpd: Syntax error on line 62 of C:/Apache24/conf/httpd.conf: Invalid LoadModule path \x93c:/php7/php7apache2_4.dll\x94. \x93\x94 CP1252编码,用于花式打开和结束引号.消除这些问题或将其替换为常规引号即可解决此问题,此后,Apache在PHP上运行顺利.

In my case, I had the problem paulsm4 referred to about quotes. I copied and pasted the code from a website and noticed that when I ran httpd -k start, my error was httpd: Syntax error on line 62 of C:/Apache24/conf/httpd.conf: Invalid LoadModule path \x93c:/php7/php7apache2_4.dll\x94. The \x93 and \x94 are the CP1252 encodings for fancy open and end quotes. Eliminating these or replacing them with regular quotes fixed the problem and Apache ran smoothly with PHP after that.

其他人遇到的另一个问题是尝试使用NTS(非线程安全)PHP配置Apache.

Another problem someone else ran into was trying to configure Apache with NTS (non-thread-safe) PHP.

php.net/manual/en/install.windows.apache2.php PHP下载网站也指出了这一点.

php.net/manual/en/install.windows.apache2.php The PHP download website also makes this point.

这篇关于Apache不会从PHP加载模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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