This is my code:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$fullcontent = file_get_contents("https://website.co.uk/feeds/google-feed-all-options.php");
file_put_contents("direct/google-feed.xml", $fullcontent);
In my browser it times out, however.
In the file google-feed-all-options.php I have this:
ignore_user_abort(true);
set_time_limit(0);
the code in https://website.co.uk/feeds/google-feed-all-options.php outputs to a file google-feed.xml if i put it in a crontab it works correctly and the file is complete, if i go to the url https://website.co.uk/feeds/google-feed-all-options.php in my browser, the data gets cut off and only gets to about 20% of the list of items.
meaning that if i echo out $fullcontent onto the page the content doesnt loop through the list correctly. meaning the code does work, but the main issue is that im accessing it using the browser instead of running it internally on the server.
so i have set ignore user abort which continues the script running even if it times out in the browser like it is doing, then the file completes it just doesnt output it. but ideally i need the output to come into the browser.
it is not a duplicate if you see i mention set time limit this is unlimited and the php.ini is set to 600 and the script barely reaches 20 seconds which is not a default of php if the other two didnt work.
Any ideas? I'm at a loss.