duangou6446 2011-06-29 15:50
浏览 155
已采纳

PHP警告:无法加载动态库

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

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

  • 写回答

3条回答 默认 最新

  • doupang1917 2011-06-29 16:05
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮