Reputation: 1623
How to url fopen local file? Because this is not working on my hosting
fopen("saver.php", "r");
It just opens the file for read, not for execute.
I need this to start parallel process. PHP threads and pecl
don't work on the hosting. Options are curl and fopen. But curl is waiting for a response.
Using fopen("http://myserver.com/saver.php", "r");
is not good for me. Because this request is quite slow, for starting parallel process. I want just local fopen, without sending request to outside and than back to hosting.
Upvotes: 1
Views: 2595
Reputation: 41
If you want to execute this you need use system
not open
.
http://php.net/manual/en/function.system.php
Upvotes: 1
Reputation: 514
Using a local name of the local machine should work, doesn't it?
fopen("http://localhost/saver.php", "r");
Or maybe even
require('saver.php')
Upvotes: 0