简体   繁体   English

php5不会通过apache加载扩展,但是所有模块都使用php -m显示?

[英]php5 won't load extensions through apache, but modules all show using php -m?

I've been trying to install PHP5-APC ( http://uk.php.net/apc/ ). 我一直在尝试安装PHP5-APC( http://uk.php.net/apc/ )。 I used macports to get this far. 我使用macports达到了目的。

When i run php -m , i get a list of lots of modules including apc, but the apache error log gives out: 当我运行php -m时,我得到了包括apc在内的许多模块的列表,但是apache错误日志给出了:

PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so' - (null) in Unknown on line 0

and there's no modules at all loaded in phpinfo() phpinfo()中根本没有加载任何模块

Please help! 请帮忙! I'm completely confused by this. 我对此完全感到困惑。

Thanks, 谢谢,

Dan

php-cli and mod_php are completely different runtimes. php-climod_php是完全不同的运行时。 You can easily have different version installed, and they usually read from different php.ini files. 您可以轻松地安装不同的版本,并且它们通常从不同的php.ini文件中读取。

In this case, the problem lies with the apc extension. 在这种情况下,问题出在apc扩展名上。 Try to comments it out from your php.ini file (The one that Apache uses). 尝试从您的php.ini文件(Apache使用的文件)中注释掉它。 apc is a cache, so if you only use your machine for development (You aren't hosting anything on a Mac, I presume), you don't really need it anyway. apc是一个缓存,因此,如果仅使用计算机进行开发(我想您没有在Mac上托管任何东西),那么您实际上并不需要它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM