2011-11-05 29 views
0

如何解決此問題,以便我的腳本能夠正常工作。CURLOPT_FOLLOWLOCATION錯誤?

收到此錯誤:

Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/halogam1/public_html/xbox.check/xbox.class.php on line 137

然後,我跑到這個腳本調試:

<?php 
echo ini_get('safe_mode'); 

var_dump(ini_get('open_basedir')); 
?> 

輸出:

1string(0) "" 

回答

0

我不知道你問什麼,但它看起來像安全模式啓用了你。

查看http://php.net/manual/en/function.curl-setopt.php

的意見適當剪斷是:

...then you will want to read http://www.php.net/ChangeLog-4.php which says "Disabled CURLOPT_FOLLOWLOCATION in curl when open_basedir or safe_mode are enabled." as of PHP 4.4.4/5.1.5. This is due to the fact that curl is not part of PHP and doesn't know the values of open_basedir or safe_mode, so you could comprimise your webserver operating in safe_mode by redirecting (using header('Location: ...')) to "file://" urls, which curl would have gladly retrieved.

+0

所以我怎麼能禁用safe_mode設置? – AndrewFerrara

+0

請參閱http://www.daniweb.com/web-development/php/threads/18424儘管禁用safe_mode並不是一個好主意。 – hafichuk

+0

在「safe_mode = Off」的同一個目錄下創建一個php.ini文件爲我工作 – AndrewFerrara

相關問題