执行PHP的编译命令:
sudo ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
sudo make
产生下面的错误信息:
/usr/local/src/php-5.4.3/ext/standard/info.c:105:
ext/standard/.libs/info.o: In function `php_info_printf':
/usr/local/src/php-5.4.3/ext/standard/info.c:83: undefined reference to `ts_resource_ex'
ext/standard/.libs/info.o: In function `php_info_print_html_esc':
/usr/local/src/php-5.4.3/ext/standard/info.c:69: undefined reference to `ts_resource_ex'
ext/standard/.libs/info.o: In function `php_print_gpcse_array':
/usr/local/src/php-5.4.3/ext/standard/info.c:208: undefined reference to `executor_globals_id'
ext/standard/.libs/info.o: In function `php_info_print_request_uri':
/usr/local/src/php-5.4.3/ext/standard/info.c:97: undefined reference to `sapi_globals_id'
ext/standard/.libs/info.o: In function `php_print_info':
/usr/local/src/php-5.4.3/ext/standard/info.c:874: undefined reference to `executor_globals_id'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] 错误 1
出现这样的错误信息可能是我以前用不同的参数编译过PHP。
解决方法:执行make clean删除上次的编译结果,然后再重新编译就OK了。