How can i fix this php error?
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_mysql.dll, 9): image not found in Unknown on line 0
I am on a mac/mavericks and I have made a mistake and did a sudo cp /private/etc/php.ini.default /private/etc/php.ini
so now I get the error stated above when I run php -v
Follow this as it worked for me...
The error coming for me was:
$ sudo php -v
# PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20121212/phalcon.so, 9): image not found in Unknown on line 0
# PHP 5.5.14 (cli) (built: Sep 9 2014 19:09:25)
# Copyright (c) 1997-2014 The PHP Group
# Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Run this as root:
$ locate phalcon.so
# /opt/local/lib/php55/extensions/no-debug-non-zts-20121212/phalcon.so
Run this also as root:
$ cp -rp /opt/local/lib/php55/extensions/no-debug-non-zts-20121212/phalcon.so /usr/lib/php/extensions/no-debug-non-zts-20121212/
Just edit the directories as they might differ for you.
Originally, I followed these step-by-step guides to set up apache, php, mysql, etc and and get my localhost working:
Then, I accidentally replaced my php.ini file and got the error stated above in the question. Actually, at first I got the mcrypt
missing error.
So, after fixing all of these, I had few things left to do in the php.ini file:
Declared mcrypt like this: extension=mcrypt.so
Uncommented the extension_dir line and added:
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"
I commented out the line: extension=php_pdo_mysql.dll
Done a sudo apachectl restart
Finally, everything works as is expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With