Curl_setopt (): curlopt_followlocation cannot be activated when in safe_mode or an open_basedir is set in

Source: Internet
Author: User

When safe_mode and open_basedir are enabled, use the following statement in the program:
Curl_setopt ($ curl, curlopt_followlocation, 1 );
Is there a 301,302 status error?

[14:17:41] PHP warning: curl_setopt (): curlopt_followlocation cannot be activated when in safe_mode or an open_basedir is set in MSN. Class. php on line 819

The solution is to use the curl statement instead of curl_setopt ($ ch, curlopt_followlocation, true), or change it to 0, and define a function in the PHP function.

Curl_redir_exec Function
Curl_redir_exec

Curl_redir_exec ($ ch) replace curl_setopt ($ ch, curlopt_followlocation, true) Statement

Refer:

Http://spoint.babyshoot.cn/archives/2009/11/curlopt-php.html

Http://www.php.net/manual/en/function.curl-setopt.php

Curl_setopt (): curlopt_followlocation cannot be activated when in safe_mode or an open_basedir is set in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.