许多朋友在装apache并使其支持php时,可能会遇到undefined symbol: _zend_list_delete的错误。
这是装了apache和php后,apache的配置文件httpd.conf中有启动php模块的语句
LoadModule php5_module modules/libphp5.so
而libphp5.so运行时找不到zend_list函数相关的库导致的。我从国外网站查了一些解决办法。我自己的办法是:装php时configure 加上--libdir=/usr/lib形如:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pear --with-mysql=/usr/local/mysql --libdir=/usr/lib
下面是国外网站上查的一些解决办法,请因你情况修改。
The problem is with mysql... doesn't seem obvious but this has happened
to a number of users...
Here is a fix, hopefully your mysql directories are the same
cd /usr/lib/mysql
rename .a .a_old *.a
rename .la .la_old *.la
Then run configure/make/make install
Then rename these files back.
cd /usr/lib/mysql
rename .a_old .a *.a_old
rename .la_old .la *.la_old
-----------------------------------------------
there may be some problem with the path to libc and other libs on your system.
per default php5 s configure script uses /usr/local/lib.
you might want to add some --libdir=/usr/lib to your ./configure
like
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pear --with-mcrypt --with-mysql --libdir=/usr/lib
to be sure it uses the new path do some
make clean
make distclean
before recompiling.
if /usr/lib doesent work you may look for your systems default library direcotry :)
----------------------------------------------------------------------------------------
1. Cleaned the hard drive of anything looking remotely like PHP, MySQL or Apache.
2. Built Apache 2.0.58
3. Built MySQL 5
4. Used that solution above (the one about renaming the libs; the lib files for mysql 5 is located in /usr/local/mysql/libs/mysql/)
5. Deleted the folder I used to build PHP 5, and then unarchived a fresh copy from my php-5.1.4.tar.gz file.
6. Built PHP 5
7. Named the files back as per instruction above
This got ride of all the errors, so all I can say to anybody else who is unlucky enough to get them is, clean everything that is Apache, MySQL or PHP, and then start over. That seemed to work. :)