PHP错误:libphp5。所以:未定义符号:_estrndup

时间:2023-01-30 12:43:40

I compile Apache-MySQL-PHP by hand to build a custom install using the configure options from below. When I start apache it fails to start and adds the below error in the error_log.
* Apache 2
* Mysql 5.0
* PHP 5.1
* CentOS Linux 5.4 * GCC compiler

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

the error in apache log

httpd: Syntax error on line 54 of /opt/clamp/etc/httpd.conf: Cannot load /opt/clamp/modules/libphp5.so into server: /opt/clamp/modules/libphp5.so: undefined symbol: _estrndup

httpd:在第54行/opt/夹/etc/httpd上的语法错误。相依:无法加载/ opt /夹/模块/ libphp5。所以到服务器:/ opt /夹/模块/ libphp5。所以:未定义符号:_estrndup

the ./configure options

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

APACHE。/配置\ -前缀=/opt/夹\ -sysconfdir=/opt/ /etc \ -enable-cern-meta -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --实现-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -

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

MYSQL ./configure \ -prefix=/opt/箝位\ -sysconfdir=/opt/钳/etc \ -libexecdir=/opt/钳/sbin \ -localstatedir=/opt/钳/var \ -with-unix-socket-path=/opt/钳/tmp/ MYSQL。袜子\——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

PHP ./配置\ -前缀=/opt/钳位\ -sysconfdir=/opt/钳/etc \ -with-apxs2=/opt/ bin/apxs \ -with-config-file-path=/opt/钳/etc/ PHP。conf \ -- -mysql=/opt/ \ -- -mysqli=/opt/ bin/mysql_config \ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -

3 个解决方案

#1


0  

if you are not gonna read all the error logs, you can try:

如果你不打算读所有的错误日志,你可以试试:

char *
estrndup(const char *s, size_t len)
{
    char *d = strndup(s, len);
    //if (d == NULL)
    //  (*efunc)(1, "Cannot copy string");
    return d;
}

#2


0  

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

似乎我并没有构建PHP的GD库,使用以下选项构建PHP(不再出错):

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

cd php-5.2.13/ ./配置\ -前缀=/opt/钳位\ -sysconfdir=/opt/钳/ /etc \ -- -- -文件路径=/opt/钳/etc/php。conf \——disable-debug \ with-pic \——disable-rpath \——without-pear \ with-bz2 \——使用curl \——with-freetype-dir = / usr \ with-png-dir = / usr \——enable-gd-native-ttf \ without-gdbm \——with-gettext \——gmp \ with-iconv \ with-jpeg-dir = / usr \——使用openssl \ with-pspell \——with-zlib \——with-layout = GNU \ enable-exif \——enable-ftp \ enable-magic-quotes \——enable-sockets \ enable-sysvsem——enable-sysvshm enable-sysvmsg \使用kerberos——enable-wddx \ \-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -实现-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

#3


-1  

It means you haven't got your php build correctly, probably because you have make it several times, like I did, and only the last time you got through. Between these times of builds you have installed some supporting packages along the way, which you forgot to do at the beginning. Therefore you without make clean you end up with something that is not clean. And Apache is just too picky to do it. So the best try is to run 'make clean' again and rebuild php to see what really happend.

这意味着您没有正确地构建php,可能是因为您已经做了好几次了,就像我做的那样,而且是您最后一次完成的时候。在这些构建阶段之间,您已经安装了一些支持包,您在开始时就忘记了。因此,你若不清洁,就会得到不洁净的东西。Apache太挑剔了。因此,最好的方法是再次运行“make clean”,然后重新构建php,看看到底发生了什么。

#1


0  

if you are not gonna read all the error logs, you can try:

如果你不打算读所有的错误日志,你可以试试:

char *
estrndup(const char *s, size_t len)
{
    char *d = strndup(s, len);
    //if (d == NULL)
    //  (*efunc)(1, "Cannot copy string");
    return d;
}

#2


0  

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

似乎我并没有构建PHP的GD库,使用以下选项构建PHP(不再出错):

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

cd php-5.2.13/ ./配置\ -前缀=/opt/钳位\ -sysconfdir=/opt/钳/ /etc \ -- -- -文件路径=/opt/钳/etc/php。conf \——disable-debug \ with-pic \——disable-rpath \——without-pear \ with-bz2 \——使用curl \——with-freetype-dir = / usr \ with-png-dir = / usr \——enable-gd-native-ttf \ without-gdbm \——with-gettext \——gmp \ with-iconv \ with-jpeg-dir = / usr \——使用openssl \ with-pspell \——with-zlib \——with-layout = GNU \ enable-exif \——enable-ftp \ enable-magic-quotes \——enable-sockets \ enable-sysvsem——enable-sysvshm enable-sysvmsg \使用kerberos——enable-wddx \ \-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -实现-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

#3


-1  

It means you haven't got your php build correctly, probably because you have make it several times, like I did, and only the last time you got through. Between these times of builds you have installed some supporting packages along the way, which you forgot to do at the beginning. Therefore you without make clean you end up with something that is not clean. And Apache is just too picky to do it. So the best try is to run 'make clean' again and rebuild php to see what really happend.

这意味着您没有正确地构建php,可能是因为您已经做了好几次了,就像我做的那样,而且是您最后一次完成的时候。在这些构建阶段之间,您已经安装了一些支持包,您在开始时就忘记了。因此,你若不清洁,就会得到不洁净的东西。Apache太挑剔了。因此,最好的方法是再次运行“make clean”,然后重新构建php,看看到底发生了什么。