PHP的警告:无法加载动态库 [英] PHP Warning: Unable to load dynamic library

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

问题描述

好吧,我让PHP工作在我的Mac OS X的Apache 2服务器。
我有问题是,它似乎无法找到让我连接到一个SQLite数据库的扩展。

Ok I have PHP working on my mac os x Apache 2 server. Problem I am having is it can't seem to find the extensions that allow me to connect to an sqlite database.

extension = php_sqlite.dll
extension = php_pdo_sqlite.dll
extension = php_sqlite3.dll

我现在得到这个错误,我注释掉这些扩展。

I get this error now that I have uncommented these extensions..

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

这是所有3.结果相同的错误
现在,我已阅读在互联网上的不同地方,它可能是因为他们没有我的Mac上安装,但我不能找到PHP目录或任何地方他们会!结果
我很新的这所以任何帮助将是盛大
迪斯科

It is the same error for all 3.
Now I have read in different places on the internet it could be that they aren't installed on my mac, but I can't find the PHP directory or anywhere where they would be!
I'm very new to this so any help would be grand Disco

推荐答案

您已经启用的DLL扩展实际上是为Windows。在Mac和其他* nix平台,它们实际上是SO文件。

The DLL extension you've enabled are actually for Windows. On Mac and other *nix platforms, they're actually SO files.

我在Mac上,以及它看来,SQLite的模块已经加载。您应该能够注释掉那些行的的php.ini 文件,重新启动Apache和使用SQLite,而无需做任何事情。 SQLite的模块已被列入,只要我还记得。

I'm on a Mac as well as it appears that the SQLite modules are already loaded. You should be able to comment out those lines in your php.ini file, restart Apache and use SQLite without having to do anything. The SQLite modules have been included for as long as I can remember.

如果它真的不包括在内,你必须从源代码编译的模块。这需要您安装苹果开发工具

If it's really not included, you'll have to compile the modules from source. That requires that you install the Apple Developer Tools.

编译从头开始(命令行):


  1. 下载PHP的源$ C ​​$ C 。你需要下载一个已经安装在系统上的版本相匹配的。要找出一个你正在使用,键入 PHP -v 在命令行。

  2. 提取您下载使用焦油-zxvf 后跟文件名归档。

  3. 键入 CD的php-5.3.x / EXT / sqlite3的/ (其中,5.3.x应该与你的版本号和sqlite3的取代可以是任何你想要的模块从你的列表上方减去PHP_preFIX)安装。

  4. 键入运行phpize

  5. 键入 ./配置

  6. 键入制作

  7. 键入须藤使安装

  8. 添加扩展= sqlite3.so 你的的php.ini (再次确保与sqlite3.so取代其他扩展名的,如果你编译其他人)的名称。

  1. Download the PHP's source code. You'll need to download the one that matches the version already installed on your system. To find out which one you're using, type php -v from the command line.
  2. Extract the archive you downloaded using tar -zxvf followed by the filename.
  3. Type cd php-5.3.x/ext/sqlite3/ (where "5.3.x" should be replaced with your version number and "sqlite3" can be any of the modules you want to install from your list above minus the "php_" prefix).
  4. Type phpize.
  5. Type ./configure.
  6. Type make.
  7. Type sudo make install.
  8. Add extension=sqlite3.so to your php.ini (again make sure to replace sqlite3.so with the name of the other extensions if you compile the others).

最后,重新启动Apache,你应该做的。

Finally, restart Apache and you should be done.

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

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