Mailing List


Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To Gmail
Voicemail To Gmail

How Long For Me
My Music To Me


NerdyHearn - Blog

<< Back To All Blogs

Resolving CURLOPT_FOLLOWLOCATION cannot be activated with PHP and CURL

Thursday, June 6th, 2013

We were recently using a class we had created to access RETS/MLS in PHP which required that both cookies could be written locally and CURLOPT_FOLLOWLOCATION was enabled.

The actual error was CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /var/file/location

We are running this particular site as a virtual host on Apache.

To both disable safe mode as well as remove the open_basedir issue follow these instructions. Please note that safe mode is going away in future versions of PHP.

1. Fire up your UNIX shell of choice, navigate to the location of your httpd.conf file for the virtual host (or your single httpd.conf file with multiple virtual hosts enabled):

#: cd /var/www/virtualhosts/

2. Edit the file
# vi httpd.conf

3. Add the following 2 lines to the required location in your httpd.conf file and save the edits:
php_admin_flag safe_mode off
php_admin_flag open_basedir none

4. Reload the apache service
#: service httpd reload

You're all set!

Optionally you could also change this configuration in the default php.ini file, but this is a much safer and restricted approach.

Apachein' Tom Out.


Apache PHP

Related Blogs

Fedora Core 20 and Apache Virtual Host on mounted share
Implementing AJAX with PHP and MySQL
Calling .NET WebService From PHP
Simple encryption class for PHP
Parsing XML in PHP with SimpleXML


Currently no comments.

Add A Comment



Email Address: (not public, used to send notifications on further comments)


Enter the text above, except for the 1st and last character:

NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations