由于无论何时我将服务器更新到PHP7或当我为服务器启用AutoSSL时,我都无法上载文件。我的错误如下allow_url_fopen已打开,但phpinfo已关闭
fopen(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
我不知道在哪里了allow_url_fopen = 0是由因为在这两种全球的php.ini和子域的内部在php.ini未来使用说明
allow_url_fopen=On
allow_url_include = On
在phpinfo()函数我看到我的php.ini文件是...
Configuration File (php.ini) Path /opt/cpanel/ea-php70/root/etc
Loaded Configuration File /opt/cpanel/ea-php70/root/etc/php.ini
当我打开这个php.ini文件我看到allow_file_fopen为 “开”
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On
; Whether to allow include/require to open URLs (like http:// or ftp://) as fil$
; http://php.net/allow-url-include
allow_url_include = On
但在相同的phpinfo()文件我看到allow_file_fopen熄灭
Directive Local Value Master Value
allow_url_fopen Off Off
allow_url_include Off Off
从另一个堆栈交换线程有人告诉我,试试下面的代码,原来它是OFF
if (ini_get("allow_url_fopen") == 'On') {
echo "allow_url_fopen is ON";
} else {
echo "allow_url_fopen is OFF";
}
以前我没有用在我的控制器下面的代码得到这个工作,但是这不再适用的一个原因我不知道
ini_set('allow_url_fopen',1);
我正在使用Laravel 5.2和Image干预软件包来处理上传的图像。正如我所说,这是所有PHP7和AutoSSL之前工作
我错过了什么?
您是否在修改php.ini后重新启动了您的网络服务器(Apache?)? – Halcyon
是的,我做到了。但仍然没有任何变化 – warmwhisky
请输入'php --ini'并查看,如果您的安装也正在加载其他ini文件。如果是这样(尤其是使用cpanel),可能会有机会,该设置在另外的ini-file中被禁用,因此会覆盖您的(手动)设置。 – dognose