Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whenever I run my php command line script, before the script actually outputs to the screen, php always returns a bunch of error messages as follows:

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

However, the warnings doesn't really seem to stop my scripts from running properly (although it says certain libraries couldn't be loaded, but I can still use them in my scripts). I am currently running php5.2 installed via macports for Leopard 10.5.7

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

and I switch to php5.2 via this simple shell script

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

Am I doing anything wrong? Is there any way to remove the warnings returned during php initialization?

share|improve this question
    
Are those libraries where they're expected to be? – random Sep 12 '09 at 12:39

I've seen a similar question somewhere; it was recommended to do all deactivations first, then all activations, in case some modules are dependent on others. So change your script to:

port deactivate php5 @5.3.0_2+apache2+macosx+mysql5+pear+postgresql83
port deactivate php5-syck @0.55_2
port deactivate php5-memcache @2.2.5_1
port deactivate php5-xdebug @2.0.5_0

port activate php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql83
port activate php5-syck @0.55_1
port activate php5-memcache @2.2.5_0
port activate php5-xdebug @2.0.4_0

/opt/local/apache2/bin/apachectl restart
share|improve this answer

you may want to check what php.ini file is used since under some unix based systems php has separate php.ini files for mod_php and cli interfaces.

if that's the case - you should check for settings in cli php.ini file.

share|improve this answer

Another thought - deactivate all the php extensions forst the deactivate php the activate php then activate the extensions.

Just in case there are other dependencies

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .