On localhost I normally do this
file_put_contents('/script.zip', file_get_contents('http://example.com/script.zip'));
But it seems on my vps the php file doesn't get doesn't 'detect' the current
directory. So I have to get document_root and manually set the path.
$root = $_SERVER['DOCUMENT_ROOT'];
file_put_contents($root.'/script.zip', file_get_contents('http://example.com/thescript.zip'));
I'm sure there must be a way to configure nginx or php to automatically
detect the current dir, but I can't seem to find how to do that. Maybe
I don't know how to search this specific issue.