執行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了。