0

我使用下面的配置选项手动编译 Apache-MySQL-PHP 以构建自定义安装。当我启动 apache 时,它​​无法启动并在 error_log 中添加以下错误。
* Apache 2
* Mysql 5.0
* PHP 5.1
* CentOS Linux 5.4 * GCC 编译器

apache日志中的错误

httpd:/opt/clamp/etc/httpd.conf 第 54 行的语法错误:无法将 /opt/clamp/modules/libphp5.so 加载到服务器中:/opt/clamp/modules/libphp5.so:未定义符号:_estrndup

./config 选项

APACHE ./configure \ --prefix=/opt/clamp \ --sysconfdir=/opt/clamp/etc \ --enable-auth-dbm \ --enable-cern-meta \ --enable-auth-digest \ - -enable-charset-lite \ --enable-deflate \ --enable-expires \ --enable-cache \ --enable-disk-cache \ --enable-file-cache \ --enable-headers \ --enable -info \ --enable-mime-magic \ --enable-proxy \ --enable-proxy-ajp \ --enable-proxy-balancer \ --enable-proxy-connect \ --enable-proxy-ftp \ - -enable-proxy-http \ --enable-rewrite \ --enable-so \ --enable-ssl

MYSQL ./configure \ --prefix=/opt/clamp \ --sysconfdir=/opt/clamp/etc \ --libexecdir=/opt/clamp/sbin \ --localstatedir=/opt/clamp/var \ --with -unix-socket-path=/opt/clamp/tmp/mysql.sock \ --enable-thread-safe

PHP ./configure \ --prefix=/opt/clamp \ --sysconfdir=/opt/clamp/etc \ --with-apxs2=/opt/clamp/bin/apxs \ --with-config-file-path= /opt/clamp/etc/php.conf\--with-mysql=/opt/clamp\--with-mysqli=/opt/clamp/bin/mysql_config\--enable-force-cgi-redirect\--disable -cgi \ --with-zlib \ --with-gettext \ --with-gdbm \ --with-ldap \ --with-ldap-sasl \ --enable-zip \ --with-bz2 \ --with -gd \ --with-jpeg-dir=/usr \ --with-png-dir=/usr

4

3 回答 3

0

It seems that I wasn't building PHP's GD library right, building PHP with the following options worked (no more error):

cd php-5.2.13/ ./configure \ --prefix=/opt/clamp \ --sysconfdir=/opt/clamp/etc \ --with-apxs2=/opt/clamp/bin/apxs \ --with-config-file-path=/opt/clamp/etc/php.conf \ --disable-debug \ --with-pic \ --disable-rpath \ --without-pear \ --with-bz2 \ --with-curl \ --with-freetype-dir=/usr \ --with-png-dir=/usr \ --enable-gd-native-ttf \ --without-gdbm \ --with-gettext \ --with-gmp \ --with-iconv \ --with-jpeg-dir=/usr \ --with-openssl \ --with-pspell \ --with-zlib \ --with-layout=GNU \ --enable-exif \ --enable-ftp \ --enable-magic-quotes \ --enable-sockets \ --enable-sysvsem --enable-sysvshm --enable-sysvmsg \ --enable-wddx \ --with-kerberos \ --enable-ucd-snmp-hack \ --enable-shmop \ --enable-calendar \ --without-sqlite \ --enable-force-cgi-redirect \ --enable-pcntl \ --with-imap --with-imap-ssl \ --enable-mbstring \ --enable-mbregex \ --with-ncurses \ --with-gd \ --enable-bcmath \ --with-xmlrpc \ --with-ldap --with-ldap-sasl \ --with-mysql=/opt/clamp \ --with-mysqli=/opt/clamp/bin/mysql_config \ --enable-dom \ --with-pgsql \ --enable-soap \ --enable-xmlreader --enable-xmlwriter \ --enable-fastcgi make make install

于 2010-04-20T16:06:33.960 回答
0

如果您不打算阅读所有错误日志,可以尝试:

char *
estrndup(const char *s, size_t len)
{
    char *d = strndup(s, len);
    //if (d == NULL)
    //  (*efunc)(1, "Cannot copy string");
    return d;
}
于 2010-03-07T19:49:27.823 回答
-1

这意味着你没有正确构建你的 php,可能是因为你已经做了好几次,就像我一样,而且只是你最后一次通过。在这些构建时间之间,您已经安装了一些支持包,而您一开始就忘记了。因此,如果您没有 make clean,您最终会得到一些不干净的东西。Apache 太挑剔了。所以最好的尝试是再次运行 'make clean' 并重建 php 以查看真正发生了什么。

于 2013-04-01T23:15:16.983 回答