@ anca-phpdoc at anca dot tv:
You can use ./configure --with-libxml-dir=/path_to_xml2-config
章 54. 编译问题本节汇集了大多数编译时出现的常见错误。
你必须安装有 GNU 的 autoconf 包,这样才可以从 configure.in 生成 configure 脚本。从 CVS 得到源程序后只要在最高层的目录中运行 ./buildconf 即可。(同样,除非你用了 --enable-maintainer-mode 选项来运行 configure,否则即使 configure.in 文件更新了,configure 脚本也不会自动重新生成。所以当你发现 configure.in 文件更新了时要确保手工重新生成 configure 脚本。有一个症状是在 configure 之后或者运行 config.status 时在 Makefile 中寻找类似 @VARIABLE@ 的东西。)
你需要告诉 configure/setup 脚本你的 Apache
源程序最上层的目录位置。这意味着你需要这样指定
3. 当运行 PHP 配置时(./configure),遇到类似如下的问题:
请认真阅读 PHP 的安装说明,并注意要编译 PHP 需要同时安装 flex 和 bison。根据设置的不同,可以从源代码编译 bison 和 flex,要么通过已编译好的发行包,例如 RPM。
该错误通常在 Apache 的核心程序被编译为共享用途的 DSO 库时发生。请尝试重新配置 Apache,确保至少使用了如下参数:
更多信息,请阅读 Apache 顶层目录的 INSTALL 文件或者 Apache 的 DSO 手册。 可以通过指定附加的选项让 configure 脚本在非标准的路径中寻找头文件和库并传递给 C 预处理器和连接器,例如:
需要更新 Bison 的版本。最新版本在 http://www.gnu.org/software/bison/bison.html。 一些旧版本的 make 没有正确将 functions 目录下编译后的文件放到同一个目录下。试试运行 cp *.o functions 然后再运行 make 看看有没有什么帮助。如果成功了,那你确实需要更新到最新版的 GNU make。 看看连接的这一行命令,确认所有适当的库都包括在最后了。通常可能漏掉了“-ldl”和你包括的任何数据库支持所需要的库。 如果和 Apache 1.2.x 一起连接,记得把适当的信息添加到配置文件的 EXTRA_LIBS 这一行并重新运行 Apache 的配置脚本了吗?更多信息见安装一章。 一些人也报告说在和 Apache 连接时他们不得不紧接着 libphp4.a 之后加上“-ldl”。 这其实很简单。小心地照着以下步骤来:
注意:也可以用新的 Apache ./configure 脚本。参见 Apache 发行包中 README.configure 文件中的说明。也看看 PHP 发行包中的 INSTALL 文件。 这说明 PHP 模块出于某些原因没有被调用。在寻求更多帮助前先检查三件事:
11. 说要用:--activate-module=src/modules/php4/libphp4.a,但是此文件根本不存在,于是我改成了 --activate-module=src/modules/php4/libmodphp4.a,结果不行。怎么回事? 注意 libphp4.a 文件本来就不该存在,apache 进程将创建它! 这是一个 Apache 误报的错误信息,在新的版本中已经修正了。 这里要检查三件事。首先,出于某些原因当 Apache 生成 apxs Perl 脚本时,有时没有正确的编译和标记变量就结束了。找到你的 apxs 脚本(用命令 which apxs),有时会在 /usr/local/apache/bin/apxs 或者 /usr/sbin/apxs。打开并检查类似如下的行:
如果 make 时遇到类似这样的问题:
你的系统坏了。你需要安装一个符合你的 glibc 的 glibc-devel 包来修复 /usr/include 中的文件。这和 PHP 绝对没有任何关系。要证实这一点,试试这个简单的测试:
15. 当带 MySQL 编译 PHP 时,可以正确地运行配置,但是在 make 的过程中出现了类似以下的错误信息: ext/mysql/libmysql/my_tempnam.o(.text+0x46): In function my_tempnam': /php4/ext/mysql/libmysql/my_tempnam.c:103: the use of tempnam' is dangerous, better use mkstemp',这是怎么回事 首先,我们需要认识到这只是个警告,而非致命错误。由于这条信息通常是在 make 的最后输出的,所以看起来它可能像是一个致命错误,但实际上不是。当然,如果将编译器设置成遇见警告信息时停止,则这也可以算是致命错误。另外值得一提的是,MySQL 的支持是默认打开的。
要么在你当前的 PHP 的安装目录查看 config.nice 文件,如果没有,只要运行此脚本:
05-May-2007 01:48
@ anca-phpdoc at anca dot tv:
chris dot good at NOSPAM dot infor dot com
10-May-2006 07:12
Re Solaris
timothy at imail dot ru
02-May-2006 02:24
Note on PHP5 setup under RedHat 7
anca-phpdoc at anca dot tv
09-Dec-2005 03:48
For the configure newbies among us:
datemplar at freePotatoes dot fr
04-Oct-2005 12:15
If the option --with-apsx2=/path/to/apxs seems to have absolutely no effect and if the configure script ignores the Apache 2.x support, try to shutdown your Apache server (/path/to/bin/apachectl stop) and retry.
didier b.
07-Aug-2005 11:52
I post here because I was unable to find the information on the web.
brad at computechnv dot com
07-Apr-2005 10:07
My problem was actually with mod_dav (which referred me here). Since they took the time to point people here, I thought I'd go ahead and add my two cents worth and expand on the above since it obviously affects PHP as well. I am running Fedora Core 3, Apache 2.0.53, & PHP 5.03. Apache and PHP were built from source.
dl927 at torfree dot net
12-Feb-2004 05:17
Compiling mod_php4 port on a clean freeBSD 4.8 install for Apache2 needed FOR_APACHE2= yes manually inserted into Makefile prior to version check.
dale at botkin dot org
04-Nov-2002 10:20
If you have customized your Apache to lie about its version number, you may need to edit configure to skip the version number check. Just /APACHE_VERSION in configure to find the instance(s) where configure checks to make sure you have the right combination of --with-apxs or --with_apxs2 and Apache 1.3 or 2.0. Assuming you're smart enough to remember which version of Apache you have, you can just delete or comment out the version check and continue to march.
jimsteele at nospam dot com
14-Oct-2001 08:43
Defining the right environment variables for my Apache "make" invocation allowed the correct "apxs" file to be generated for me. Your mileage may vary. | |||||||||||||||