我在我的php应用程序中包含一个phar文件(goutte.phar).当我尝试点击网址时,我收到与服务器的连接被重置错



php.ini中是否有任何特定设置需要更改以允许服务器包含该文件?

require_once dirname(dirname(__FILE__)).'/unleashapi/protected/extensions/goutte.phar';

您可以在php.ini auto_prepend_file中设置:

auto_prepend_file="/custom/path/unleashapi/protected/extensions/goutte.phar"

确保 Apache 有权访问该文件。

如果你的服务器使用的是suhosin(通常是Debian和所有基于Debian的发行版),你应该在你的php中添加:suhosin.executor.include.whitelist="phar".ini

最新更新