tags:

views:

144

answers:

3
Warning: file_get_contents(http://localhost/sample_pie.php) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\EXACT\report.php on line 206

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\EXACT\report.php on line 206

here is the line 206:

$url = 'http://localhost/sample_pie.php';
$img = 'C:\xampp\htdocs\piechart.jpg';
file_put_contents($img, file_get_contents($url));

what do i have to do?

+4  A: 

Your script executed for more then 60 seconds and was terminated. There is a value in php.ini defining maximum time PHP script can run. The purpose of this is to prevent scripts from hanging. You could try to optimize your script but if it's intended to run for so long you can just update the value (it's called max_execution_time).

You can also try changing this value for particular script by running set_time_limit() function, docs here

RaYell
A: 

It means PHP was unable to access the resource http://localhost/sample_pie.php, and thus the operation timed out. Try to access it through the browser.

JG
A: 

The error means that PHP is not able to open http://localhost/sample%5Fpie.php to read the contents of the file. See if you are able to open the http://localhost/sample%5Fpie.php file in browser.

Also is the page very large?

Sudar