OSX:PHP错误本地主机并且无法加载动态库 [英] OSX: PHP Error localhost and unable to load dynamic library

查看:87
本文介绍了OSX:PHP错误本地主机并且无法加载动态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决此php错误?

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

我在Mac/Mavericks上,我犯了一个错误并执行了sudo cp /private/etc/php.ini.default /private/etc/php.ini,所以现在我在运行php -v

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

推荐答案

最初,我按照这些分步指南设置了apache,php,mysql等,并使我的本地主机正常工作:

Originally, I followed these step-by-step guides to set up apache, php, mysql, etc and and get my localhost working:

  1. http://brianflove.com/2013/10 /23/os-x-mavericks-and-apache/
  2. http://coolestguidesontheplanet.com /install-mcrypt-php-mac-osx-10-9-mavericks-development-server/
  1. http://brianflove.com/2013/10/23/os-x-mavericks-and-apache/
  2. http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-9-mavericks-development-server/

然后,我不小心替换了我的php.ini文件,并得到了问题中上述错误.实际上,起初我遇到了mcrypt丢失错误.

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.

因此,在解决所有这些问题之后,在php.ini文件中我只剩下很少的事情要做了:

So, after fixing all of these, I had few things left to do in the php.ini file:

  1. 像这样声明mcrypt:extension=mcrypt.so

取消注释extension_dir行并添加: extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"

Uncommented the extension_dir line and added: extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/"

我注释掉了这一行:extension=php_pdo_mysql.dll

完成sudo apachectl restart

最后,一切都会按预期进行.

Finally, everything works as is expected.

这篇关于OSX:PHP错误本地主机并且无法加载动态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆