osx - PHP warnings after Mavericks upgrade

15
2013-12
  • TobyG

    After upgrading my Mac to Mavericks I've had a few small issues with machine, most of which I've resolved, however when I try to run PHP scripts at the command line I'm not getting these warnings...

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/yaml.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/yaml.so, 9): image not found in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): image not found in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/intl.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/intl.so, 9): image not found in Unknown on line 0
    

    The directory /usr/lib/php/extensions/no-debug-non-zts-20100525/ exists, but there is only xdebug.so & mcryt.so files in there.

    I tried installing the yaml extension using pecl but it says it's already installed.

    If I run sudo php -a rather than php -a then the other errors go away. What permissions do I need to set on what folder to get this working for non-admin accounts?

  • Answers
  • Manolo Salsas

    Run this command:

    diff /etc/php5/apache2/php.ini /etc/php5/cli/php.ini
    

    or

    find /etc/* -name php.ini
    diff /etc/.../apache2/php.ini /etc/.../cli/php.ini
    

    Maybe there is some difference that gives you the answer.


  • Related Question

    mysql - PHP Warning: PHP Startup: Unable to load dynamic library php_mysql.dll, Mac 10.6, Apache 2.2, php 5.3.0
  • Josh

    I'm trying to use the PHP CLI, and when I enter something like php test.php in the command line it returns:

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll, 9): image not found in Unknown on line 0 
    something
    

    test.php contains:

    <?php
    echo 'something';
    ?>
    

    I checked /usr/lib/php/extensions/no-debug-non-zts-20090626/, and as expected the .dll file isn't there. I'm a complete beginner when it comes to this - what is happening, and how can I fix it? A search of my system for "php_msyql.dll" reveals nothing. Does it have to do with how I compiled it? I don't have the original version of php that came with the mac, I think - I may have reinstalled it somewhere along the way.

    Any help would be appreciated!


  • Related Answers
  • peter

    On Mac you should not deal with dll files as these are Windows libraries. You should check your php.ini file for any uncommented (no semicolon in front) lines like extension= under Dynamic Extensions section and make sure that all those lines are commented. Btw to find location of php.ini file type in Terminal:

    $php --ini
    

    And it will give you something self-explanatory like:

    Configuration File (php.ini) Path: /etc
    Loaded Configuration File: /private/etc/php.ini
    
  • Josh

    Sorry about new account, (munchybunch here, dunno how to deal with the OpenID stuff) but I'm using Mac OS X Snow Leopard. I thought the .dll was weird too, and in that folder right now there's phpcups.so. I'm just confused as to what's causing it to look for the dll file. Is there a script being called somewhere trying to load it?