<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP, cURL, CURLOPT FOLLOWLOCATION and open basedir Or Safe Mode</title>
	<atom:link href="http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/</link>
	<description>Freelance PHP Ecommerce and SEO Developer in the UK</description>
	<lastBuildDate>Tue, 02 Mar 2010 10:30:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andy</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-1750</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Thu, 24 Sep 2009 18:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-1750</guid>
		<description>Wonderful, saved my life :) I used it on an connector which i wrote for plugging Wordpress and CakePHP together. In this constellation, there was no $url[&quot;query&quot;] and i got an error message. So this is my solution for that:

$new_url = $url[&#039;scheme&#039;].&#039;://&#039;.$url[&#039;host&#039;].$url[&#039;path&#039;].(array_key_exists(&#039;query&#039;, $url) &amp;&amp; $url[&#039;query&#039;] ? &#039;?&#039;.$url[&#039;query&#039;] : &#039;&#039;);

Maybe it´s usefull for someone.

Nice greetings and a big thank you for this workaround.

Andy</description>
		<content:encoded><![CDATA[<p>Wonderful, saved my life <img src='http://www.edmondscommerce.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I used it on an connector which i wrote for plugging Wordpress and CakePHP together. In this constellation, there was no $url["query"] and i got an error message. So this is my solution for that:</p>
<p>$new_url = $url['scheme'].&#8217;://&#8217;.$url['host'].$url['path'].(array_key_exists(&#8216;query&#8217;, $url) &amp;&amp; $url['query'] ? &#8216;?&#8217;.$url['query'] : &#8221;);</p>
<p>Maybe it´s usefull for someone.</p>
<p>Nice greetings and a big thank you for this workaround.</p>
<p>Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-1440</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Wed, 29 Jul 2009 10:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-1440</guid>
		<description>nd - you&#039;re right about the \n\r this worked for me.

also, error in line 6, should be:

if (ini_get(&#039;open_basedir&#039;) == &#039;&#039; &amp;&amp; ini_get(&#039;safe_mode&#039;) == &#039;Off&#039;){

in my case I also had to change the safe mode check because safe mode off is an empty string:

if (ini_get(&#039;open_basedir&#039;) == &#039;&#039; &amp;&amp; ini_get(&#039;safe_mode&#039; == &#039;&#039;)){</description>
		<content:encoded><![CDATA[<p>nd &#8211; you&#8217;re right about the \n\r this worked for me.</p>
<p>also, error in line 6, should be:</p>
<p>if (ini_get(&#8216;open_basedir&#8217;) == &#8221; &amp;&amp; ini_get(&#8217;safe_mode&#8217;) == &#8216;Off&#8217;){</p>
<p>in my case I also had to change the safe mode check because safe mode off is an empty string:</p>
<p>if (ini_get(&#8216;open_basedir&#8217;) == &#8221; &amp;&amp; ini_get(&#8217;safe_mode&#8217; == &#8221;)){</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-1284</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 07 May 2009 10:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-1284</guid>
		<description>nice one Andy.

I wonder if we could mod the function to work on any platform..

would swapping \n\n for PHP_EOL work?</description>
		<content:encoded><![CDATA[<p>nice one Andy.</p>
<p>I wonder if we could mod the function to work on any platform..</p>
<p>would swapping \n\n for PHP_EOL work?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nd</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-1283</link>
		<dc:creator>nd</dc:creator>
		<pubDate>Thu, 07 May 2009 09:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-1283</guid>
		<description>Nice code!

However, I had a problem with it since 
  explode(&quot;\n\n&quot;, $data, 2);

does not work on all platforms. Correct is
  explode(&quot;\n\r&quot;, $data, 2);

Regards,
Andy</description>
		<content:encoded><![CDATA[<p>Nice code!</p>
<p>However, I had a problem with it since<br />
  explode(&#8220;\n\n&#8221;, $data, 2);</p>
<p>does not work on all platforms. Correct is<br />
  explode(&#8220;\n\r&#8221;, $data, 2);</p>
<p>Regards,<br />
Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ali</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-1000</link>
		<dc:creator>Ali</dc:creator>
		<pubDate>Wed, 25 Feb 2009 11:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-1000</guid>
		<description>Hello, 

I am getting the error 

CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

What can be the possible solution. I didnt understand  the above script you have written</description>
		<content:encoded><![CDATA[<p>Hello, </p>
<p>I am getting the error </p>
<p>CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set</p>
<p>What can be the possible solution. I didnt understand  the above script you have written</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-926</link>
		<dc:creator>Karl</dc:creator>
		<pubDate>Thu, 05 Feb 2009 23:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-926</guid>
		<description>Very nice, works like a treat. Am using it with domdocument and xpath to scrape content from various sources.

Quick tip: obvious, but for php novices, you&#039;ll need to add something like the following to your code to actually start the process

$html=curl(&#039;http://www.urltobeparsed.com&#039;);

See here for more info: http://www.merchantos.com/makebeta/php/scraping-links-with-php/</description>
		<content:encoded><![CDATA[<p>Very nice, works like a treat. Am using it with domdocument and xpath to scrape content from various sources.</p>
<p>Quick tip: obvious, but for php novices, you&#8217;ll need to add something like the following to your code to actually start the process</p>
<p>$html=curl(&#8216;http://www.urltobeparsed.com&#8217;);</p>
<p>See here for more info: <a href="http://www.merchantos.com/makebeta/php/scraping-links-with-php/" rel="nofollow">http://www.merchantos.com/makebeta/php/scraping-links-with-php/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-865</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 19 Jan 2009 09:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-865</guid>
		<description>oops sorry about that- i have add this in there.</description>
		<content:encoded><![CDATA[<p>oops sorry about that- i have add this in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sakao</title>
		<link>http://www.edmondscommerce.co.uk/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/comment-page-1/#comment-861</link>
		<dc:creator>sakao</dc:creator>
		<pubDate>Sun, 18 Jan 2009 11:08:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.edmondscommerce.co.uk/blog/curl/php-curl-curlopt_followlocation-and-open_basedir-or-safe-mode/#comment-861</guid>
		<description>this is not a working code
as far as i can see
there&#039;s no 
$go = curl_init($url);
in the first line</description>
		<content:encoded><![CDATA[<p>this is not a working code<br />
as far as i can see<br />
there&#8217;s no<br />
$go = curl_init($url);<br />
in the first line</p>
]]></content:encoded>
	</item>
</channel>
</rss>
