News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Web Developement Blog:
Curl Location redirect while open_basedir is set
February 04, 2009 @ 12:06:09

Recently on the Web Developement Blog, Olaf showed how to do a Location redirect with cURL while open_basedir is set.

If you need to follow redirects within your php code using Curl and the open_basedir is set you came into some trouble. If you disable this directive all your directories with a 777 permission are not safe (if one or more website on the same server has some security issues). If you don't have additional protections you should NEVER disable the open_basedir directive (at least if you're using 3rd party applications).

He writes up a simple cURL-based link checker to see which of the URLs in question would throw an error. He modifies it so that it checked the HTTP response code from the server and, if its a 200/302/301, you know things are okay and a shell_exec can be called to execute the file from that location.

0 comments voice your opinion now!
curl location redirect shellexec openbasedir tutorial


blog comments powered by Disqus

Similar Posts

Brian Swan's Blog: Using the Windows Azure Tools for Eclipse with PHP

Alexander Netkachev's Blog: A little bit more about Zend_Controller plugins

DZone.com: Using APC correctly

Nadeau Software: PHP tip: How to get a web page using CURL

DevShed: Developing an Extensible TCP Server with Sockets in PHP


Community Events





Don't see your event here?
Let us know!


list code series laravel introduction developer release testing community framework install language configure podcast unittest interview wordpress opinion refactor threedevsandamaybe

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework