我有一个运行 CentOs 5.5 (cpanel/whm) 的 Linux VPS,我通过以下方式安装了 MailParse模块安装程序whm 部分,并且确实安装了它,安装日志的结尾:
running: make INSTALL_ROOT="/root/tmp/pear-build-root/install-mailparse-2.1.5" install
Installing shared extensions: /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib/php/extensions/no-debug-non-zts-20090626/
running: find "/root/tmp/pear-build-root/install-mailparse-2.1.5" | xargs ls -dils
508718 4 drwxr-xr-x 3 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5
508745 4 drwxr-xr-x 3 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr
508746 4 drwxr-xr-x 3 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib
508747 4 drwxr-xr-x 3 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib/php
508748 4 drwxr-xr-x 3 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib/php/extensions
508749 4 drwxr-xr-x 2 root root 4096 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib/php/extensions/no-debug-non-zts-20090626
508744 196 -rwxr-xr-x 1 root root 193502 Feb 6 21:08 /root/tmp/pear-build-root/install-mailparse-2.1.5/usr/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so
Build process completed successfully
Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so'
install ok: channel://pecl.php.net/mailparse-2.1.5
Extension mailparse enabled in php.ini
The mailparse.so object is not in /usr/local/lib/php/extensions/no-debug-non-zts-20090626
现在,当我尝试使用 php 的 mailparse 函数时出现以下错误:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so: cannot open shared object file: No such file or directory in Unknown on line 0
我应该怎么办?
答案1
安装脚本中的错误。“mailparse.so”位于“/usr/lib/php/extensions/no-debug-non-zts-20090626/”中,但 php 在“/usr/local/lib/php/extensions/no-debug-non-zts-20090626/”中寻找它。
在 php.ini 中将“extension=....mailparse.so”修复为“extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/mailparse.so”或“extension=mailparse.so”(如果 extesion_dir 正确)。
运行“find /usr/local/lib/ -type f -name "*.ini" -exec grep mailparse {} \; -print”来查找 php 配置文件。
编辑 php 配置文件后,从 cPanel 或“service httpd restart”重新启动 Apache。