CURLOPT_FOLLOWLOCATION 无法激活 [英] CURLOPT_FOLLOWLOCATION cannot be activated
问题描述
所以我在多个服务器上不断收到这个烦人的错误(这是一个警告,所以我会忽略它,但我需要这个功能)
So I keep getting this annoying error on multiple servers(its a warning, so I'd ignore it, but I need the function)
警告:curl_setopt() [function.curl-setopt]:启用 safe_mode 或在第 56 行的/home/xxx/public_html/xxx.php 中设置 open_basedir 时无法激活 CURLOPT_FOLLOWLOCATION
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /home/xxx/public_html/xxx.php on line 56
我将如何通过 SSH 解决此问题?
How would I go about fixing this via SSH?
推荐答案
在 php.ini 文件中设置 safe_mode = Off
(通常在服务器的/etc/中).如果它已经关闭,那么在 php.ini 文件中查看 open_basedir
内容,并相应地更改它.
Set safe_mode = Off
in your php.ini file (it's usually in /etc/ on the server). If that's already off, then look around for the open_basedir
stuff in the php.ini file, and change it accordingly.
基本上,Follow location 选项已被禁用作为安全措施,但 PHP 的内置安全功能通常比安全更烦人.事实上,safe_mode
在 PHP 5.3 中已弃用.
Basically, the follow location option has been disabled as a security measure, but PHP's built-in security features are usually more annoying than secure. In fact, safe_mode
is deprecated in PHP 5.3.
这篇关于CURLOPT_FOLLOWLOCATION 无法激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!