php cURL function 301 error

后端 未结 2 1043
独厮守ぢ
独厮守ぢ 2020-12-19 06:56

I am using this code :

function getUrl($url) {
if(@function_exists(\'curl_init\')) {
    $cookie = tempnam (\"/tmp\", \"CURLCOOKIE\");
    $ch = curl_init();         


        
2条回答
  •  星月不相逢
    2020-12-19 07:43

    CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

    You may try this:

    Solution 1:

    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 comment that line (#open_basedir...). Restart apache server.

    Solution 2:
    If the above doesn't work (it should!) try this:

    
    

提交回复
热议问题