我尝试自己编译支持 ZTS 的 PHP5.4,效果很好,但似乎每当我使用 apt-get 安装扩展(如 apt-get install php5-mysql)时,它都不会安装到新编译的 PHP 的扩展文件夹中,也不会在 php.ini 中启用。此外,许多 .so 文件都丢失了(似乎构建中的 php.ini 是为 Windows 制作的?)。
但是,我想以某种方式删除与 PHP 相关的所有内容,以便我可以使用更干净的系统再次尝试。有什么简单的方法可以做到这一点吗?
我尝试从源文件夹复制文件。
我尝试了本教程并将版本替换为 5.4.37:http://eddmann.com/posts/compiling-php-5-5-with-zts-and-pthreads-support/
我最近遇到的错误
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo.so' - /usr/lib/php5/20100525/pdo.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/curl.so' - /usr/lib/php5/20100525/curl.so: undefined symbol: core_globals_id in Unknown on line 0
PHP Warning: PHP Startup: enchant: Unable to initialize module\nModule compiled with build ID=API20100525,TS\nPHP compiled with build ID=API20100525,NTS\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/gd.so' - /usr/lib/php5/20100525/gd.so: undefined symbol: ts_resource_ex in Unknown on line 0
PHP Warning: PHP Startup: gmp: Unable to initialize module\nModule compiled with build ID=API20100525,TS\nPHP compiled with build ID=API20100525,NTS\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/imap.so' - /usr/lib/php5/20100525/imap.so: undefined symbol: file_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/interbase.so' - /usr/lib/php5/20100525/interbase.so: undefined symbol: core_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/intl.so' - /usr/lib/php5/20100525/intl.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/ldap.so' - /usr/lib/php5/20100525/ldap.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mssql.so' - /usr/lib/php5/20100525/mssql.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/odbc.so' - /usr/lib/php5/20100525/odbc.so: undefined symbol: core_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_dblib.so' - /usr/lib/php5/20100525/pdo_dblib.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_firebird.so' - /usr/lib/php5/20100525/pdo_firebird.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_mysql.so' - /usr/lib/php5/20100525/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_odbc.so' - /usr/lib/php5/20100525/pdo_odbc.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_pgsql.so' - /usr/lib/php5/20100525/pdo_pgsql.so: undefined symbol: pdo_parse_params in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/pdo_sqlite.so' - /usr/lib/php5/20100525/pdo_sqlite.so: undefined symbol: core_globals_id in Unknown on line 0
PHP Warning: PHP Startup: pspell: Unable to initialize module\nModule compiled with build ID=API20100525,TS\nPHP compiled with build ID=API20100525,NTS\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: recode: Unable to initialize module\nModule compiled with build ID=API20100525,TS\nPHP compiled with build ID=API20100525,NTS\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/snmp.so' - /usr/lib/php5/20100525/snmp.so: undefined symbol: executor_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/sqlite3.so' - /usr/lib/php5/20100525/sqlite3.so: undefined symbol: core_globals_id in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/tidy.so' - /usr/lib/php5/20100525/tidy.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/xmlrpc.so' - /usr/lib/php5/20100525/xmlrpc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/xsl.so' - /usr/lib/php5/20100525/xsl.so: cannot open shared object file: No such file or directory in Unknown on line 0
[Wed Feb 18 14:26:15 2015] [notice] Apache/2.2.22 (Debian) PHP/5.4.36-0+deb7u3 configured -- resuming normal operations
[Wed Feb 18 14:26:19 2015] [error] [client 5.10.162.170] Couldn't locate driver named mysql
答案1
我会尝试这个:
sudo rm /usr/lib/php5
sudo apt-get update
sudo apt-get install php5
sudo apt-get purge php5
sudo apt-get clean
希望这对你有用。