When the system turns on Safe_mode and Open_basedir

Source: Internet
Author: User

When the system turns on Safe_mode and Open_basedir, use the following statement in the program
curl_setopt ($curl, curlopt_followlocation, 1);
And if you encounter a 301,302 status, an error will occur.

[11-oct-2010 14:17:41] PHP warning:curl_setopt (): curlopt_followlocation cannot be activated when in Safe_mode or an open_basedir are set in MSN. class.php on line 819

The workaround is to use the Curl statement to customize a function in the PHP function without using curl_setopt ($ch, curlopt_followlocation, True)

curl_redir_exec function
Curl_redir_exec

Curl_redir_exec ($ch) Replace curl_setopt ($ch, curlopt_followlocation, true) statement

When the system turns on Safe_mode and Open_basedir

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.