Note that there are some explanatory texts on larger screens.

plurals
  1. POcURL with lots of URLs: Unknown error
    primarykey
    data
    text
    <p>I'm having a strange problem with cURL that I'm drawing an absolute blank to. It works completely fine locally, but when I upload the files to my webhost and test it over there, it doesn't work at all - it loads for about 2 minutes, and then displays:</p> <blockquote> <p><strong>Server error.</strong></p> <p>The website encountered an error while retrieving <strong>http://www.craigwatcher.me/playground/units.php</strong>. It may be down for maintenance or configured incorrectly.</p> </blockquote> <p>I've checked the error logs but nothing new is being added into there. Basically I'm just iterating through a list of URLs and cURLing each of them. Let me show you the code that I'm working with:</p> <pre><code>ini_set('max_execution_time',0); require_once('../system/utilities.php'); // This will give us our getLocations() function, which has been tested to work 100% both locally and online $categories = array('jjj', 'ggg', 'bbb', 'sss', 'hhh'); $locations = getLocations(); if (!$locations) exit; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT, 10); foreach ($locations as $country =&gt; $cities) { $countryCode = getCountryCode($country); foreach ($cities as $city) { foreach ($categories as $category) { $url=$city.'.en.craigslist.'.$countryCode.'/'.$category.'/index.rss'; echo $url.'&lt;br/&gt;'; curl_setopt($ch, CURLOPT_URL, $url); $rss = curl_exec($ch); if (!$rss) echo ' FAILED to load: '.$url.'&lt;br/&gt;'; } } } curl_close($ch); </code></pre> <p>I've already tested everything else (eg. the <code>getLocations()</code> and <code>getCountryCode()</code>, and they prove to work 100% fine both locally and online. What could it <strong>POSSIBLY</strong> be!? I'm pulling my hair out over here, my mind is boggling and I'm completely lost at what could possibly be going wrong.</p> <p>I've also asked over on PHPFreaks: <a href="http://www.phpfreaks.com/forums/php-coding-help/error-w-curl-%28lots-of-urls%29/" rel="nofollow">post</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload