I’ve got on my server PHP file, which download something using curl from another server, and save it to db in nested php function. This process is little time-consuming, when I open it in my browser, I must wait ca. 1 minute, but all downloaded records are correct.
Problem is in CRON wget/curl download. When I use
wget http://myserver/myscript.php, or curl http://myserver/myscript.php, connection is closed after 1 byte, and nothing happens on server…
Where make I mistake? Maybe some headers? Why wget/curl don’t wait on end of my PHP function like browser? I hope, that require of wp-load.php (I must use for it some WordPress functions) isn’t problem?
Many thanks for responses
Code: