1

Anyone know anything about troubleshooting a PHP Curl problem? I have been using RollingCurl with great success on my OSX laptop, however when I upload to my Ubuntu server the same code fails to yield a result.

So there is clearly something wrong server side, the error logs are clean. I have no idea what to check... any help? Anyone!?

Thank you so much in advance, Stu

![http://rolling-curl.googlecode.com/svn/trunk/

Ubuntu 12.04 result 
Array ( \[url\] => \[content_type\] => \[http_code\] => 0 \[header_size\] => 0 \[request_size\] => 0 \[filetime\] => 0 \[ssl_verify_result\] => 0 \[redirect_count\] => 0 \[total_time\] => 0 \[namelookup_time\] => 0 \[connect_time\] => 0 \[pretransfer_time\] => 0 \[size_upload\] => 0 \[size_download\] => 0 \[speed_download\] => 0 \[speed_upload\] => 0 \[download_content_length\] => -1 \[upload_content_length\] => -1 \[starttransfer_time\] => 0 \[redirect_time\] => 0 \[certinfo\] => Array ( ) \[redirect_url\] => )

Local OSX Leoard result
Array ( \[url\] => http://www.google.co.uk/ \[content_type\] => text/html; charset=ISO-8859-1 \[http_code\] => 200 \[header_size\] => 1535 \[request_size\] => 108 \[filetime\] => -1 \[ssl_verify_result\] => 0 \[redirect_count\] => 1 \[total_time\] => 0.597785 \[namelookup_time\] => 0.033881 \[connect_time\] => 0.070866 \[pretransfer_time\] => 0.070939 \[size_upload\] => 0 \[size_download\] => 43439 \[speed_download\] => 72666 \[speed_upload\] => 0 \[download_content_length\] => 221 \[upload_content_length\] => 0 \[starttransfer_time\] => 0.171418 \[redirect_time\] => 0.147887 )][1] 
4
  • lets see ur rolling curl code Commented Oct 17, 2012 at 18:37
  • rolling-curl.googlecode.com/svn/trunk Using the sample data AS it works locally but not in production and of course it avoids complication. Commented Oct 17, 2012 at 18:39
  • oh ok .yeah i migrated rollingcurl code from local to remote and it worked flawlessly Commented Oct 17, 2012 at 18:43
  • Make sure you see all errors/warnings raised. For example with error_reporting(E_ALL) before running anything. Commented Oct 17, 2012 at 19:25

2 Answers 2

1
if (ini_get('safe_mode') == 'Off' || !ini_get('safe_mode')) {
 $options[CURLOPT_FOLLOWLOCATION] = 1;
 $options[CURLOPT_MAXREDIRS] = 5;
}

Here is the problem... I commented it out to test and BANG.... flys into action. Thank you all for your help.

Sign up to request clarification or add additional context in comments.

Comments

0

Check your php.ini configuration file in your ubuntu server. In this article you can see many of the good practices that many people (and now, some packages do) to protect their servers from attacks: http://blog.up-link.ro/php-security-tips-securing-php-by-hardening-php-configuration/

UPDATE.

To make it more clear:

  1. Log in to your ubuntu server as an admin user.
  2. Change to the configuration file's directory

     cd /etc/PHP5
    
  3. Search in the file for allow_url_fopen = Off value by using the following command:

    sudo nano php.ini
    
  4. Change the value to On and press CTRL+X answer "yes" to save the changes and quit nano editor

6 Comments

Without wanting to sound ungrateful that doesnt help
I am familiar with editing it but as to what need to be edited is another thing! Thank you for the clarification, I will try that and come back with the news!
As troelSkn say's turn on display_errors = Off to On to start. Default value is Off. This might give us a clue of what's happening.
added allow_url_fopen, and verified working with phpinfo(), still the same result.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.