简体   繁体   English

httpd.conf中的错误。 找不到API模块结构`php5_module'

[英]Error in httpd.conf. Can't locate API module structure `php5_module'

I've recently installed phc, the php compiler. 我最近安装了phc,即php编译器。 I started out installing LAMP from source with --enable-so for Apache and --enable-embed for PHP5 (among other options these are most relevant to the installation and later configuration). 我从使用--enable-so(对于Apache)和--enable-embed(对于PHP5)(包括其他与安装和后续配置最相关的选项)开始从源代码安装LAMP。

When I finished installing I realized phc does not yet support PHP5.3 so I uninstalled it and installed PHP5.2. 完成安装后,我意识到phc还不支持PHP5.3,因此我将其卸载并安装了PHP5.2。 phc works fine now, as does the PHP client application for the commandline. phc现在可以正常工作,命令行的PHP客户端应用程序也可以正常工作。 Apache seems to be running fine, too, when I comment out line 193 (see below). 当我注释掉第193行时,Apache似乎也运行良好(请参见下文)。 It just doesn't parse PHP. 它只是不解析PHP。

httpd: Syntax error on line 193 of /etc/apache2/conf/httpd.conf: Can't locate API module structure `php5_module' in file /usr/local/lib/libphp5.so: /usr/local/lib/libphp5.so: undefined symbol: php5_module

When I check my version of PHP from the terminal I get the expected output (5.2): 当我从终端检查我的PHP版本时,我得到了预期的输出(5.2):

[root@localhost conf]# php -v
PHP 5.2.14 (cli) (built: Sep  7 2010 22:50:25) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies

I made sure to move the libphp5.so file from the folder where I built php5.2 (/usr/local/src/php-5.2.14) to /usr/local/lib. 我确保将libphp5.so文件从构建php5.2的文件夹(/usr/local/src/php-5.2.14)移至/ usr / local / lib。 I also moved php.ini to /usr/local/lib. 我也将php.ini移到了/ usr / local / lib。

Is there something I'm missing here? 我在这里想念什么吗?

OK! 好!

Apparently when you configure PHP it's important to include the line specifying wehre to find apxs for the proper installation: 显然,在配置PHP时,重要的是包括指定用于查找正确安装apx的行:

--with-apxs2=/etc/apache2/bin/apxs

I did this and the problem vanished :) 我做到了,问题消失了:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM