每当我运行我的php命令行脚本时,在脚本实际输出到屏幕之前,php总是会返回一堆错误消息,如下所示:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/gd.so' - (null) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/mbstring.so' - (null) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/mcrypt.so' - (null) in Unknown on line 0
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/mysql.so' - (null) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so' - (null) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so' - (null) in Unknown on line 0
PHP Warning: Module 'syck' already loaded in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/zip.so' - (null) in Unknown on line 0
PHP Warning: Module 'xdebug' already loaded in Unknown on line 0
但是,警告似乎并没有阻止我的脚本正常运行(虽然它说某些库无法加载,但我仍然可以在我的脚本中使用它们)。我目前正在通过macports为Leopard 10.5.7运行php5.2
hidetoshi:bin jeffrey04$ port installed php5
The following ports are currently installed:
php5 @5.2.9_0+apache2+macosx+mysql5+pear+postgresql83
php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql83 (active)
php5 @5.3.0_1+apache2+macosx+mysql5+pear+postgresql83
php5 @5.3.0_2+apache2+macosx+mysql5+pear+postgresql83
我通过这个简单的shell脚本切换到php5.2
port deactivate php5 @5.3.0_2+apache2+macosx+mysql5+pear+postgresql83
port activate php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql83
port deactivate php5-syck @0.55_2
port activate php5-syck @0.55_1
port deactivate php5-memcache @2.2.5_1
port activate php5-memcache @2.2.5_0
port deactivate php5-xdebug @2.0.5_0
port activate php5-xdebug @2.0.4_0
/opt/local/apache2/bin/apachectl restart
我做错了吗?有没有办法删除php初始化期间返回的警告?
那些图书馆应该在哪里?
—
random