PHP Warning: Unable to load dynamic library

隐身守侯 提交于 2019-11-30 14:17:59

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

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.

To compile from scratch (from the command line):

  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).

Finally, restart Apache and you should be done.

Open php.ini. Look for the line that defines the location of your extensions. In my case (Windows machine), it goes like this:

extension_dir = "C:\xampp\php\ext"

This gives you the location where all your extensions are located. Open it and check whether your SQLite extensions are indeed there.

Also, make sure your extensions are actually meant for a Mac computer. Their filename extension should be "dylib" or maybe "so" (not sure - I don't have a Mac), while "dll" is a Windows-specific dynamic library filename extension (AFAIK).

minkyaw

Try removing and then reinstalling the packages:

brew rm mcrypt
brew install mcrypt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!