2011年5月17日 星期二

PHP Unable to load dynamic library. Solution. Suggestion.

架過站的人,一定會遇到類似以下的情況:「Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/...」。其背後的意義頗為簡單,就是找不到你所指定的外掛函式庫。以上方的情況為例,/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ 就是你所指定的外掛函式庫資料夾,你可以前往這個資料夾 ls 一下,就可以知道你目前的PHP擁有哪些 .a .so 檔可以參考。

所以,當你知道你所需要的 .so 檔是哪一個,又發現不在你的 extension 資料夾內,那麼你就要想辦法去外掛進來;另外一種可能,是 .so 檔的名稱有點差異,如 php_openssl.so 在某些 package 裡會是 openssl.so,這點也要注意。


You may encounter a problem somehow looks like 'Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/...' and here is something you need to know. In the example mensioned above, we know the extension folder is '/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/'. Enter the folder and we see what libraries we have. And now it's your turn to check out your extension folder.

If you can't find the .so file you need in the extension folder, you may try to find one and put it in the folder. Also, please pay attension to the .so filename. There might be a little difference in different package. For example, php_openssl.so may be named openssl.so.