dfound Posted October 16, 2007 Share Posted October 16, 2007 Hey, I'm trying to run a php script from the command line, but I'm having some difficulties. If I browse to my page in IE, my script executes properly, but if I run it from the command line, I receive this error: Warning: fopen() URL file-access is disabled in the server configuration in /www/public_html/update.php on line 21 Warning: fopen(): failed to open stream: no suitable wrapper could be found in /www/public_html/update.php on line 21 I'm not sure why I receive errors when trying to run on the command line and not when accessing the page through a browser... My question is, can I open the page from a command line like a browser would??? I would like to make it a cron job, and currently I try "php update.php", but that receives the error... Is there a "http update.php" or a "get update.php" that would potentially do the same thing as a browser??? Thanks Dave Quote Link to comment https://forums.phpfreaks.com/topic/73391-solved-running-php-from-command-line-issues/ Share on other sites More sharing options...
trq Posted October 16, 2007 Share Posted October 16, 2007 The issue your having seems like it may be related to where exactly you call the script from. Are you in the same directory as the script when you call it? Does the script try to open or include any files? We might need to see some code. One thing you could use to make it run exactly the same as in a browser would be to call your script via wget. eg; wget http://yourdmain.com/script.php Quote Link to comment https://forums.phpfreaks.com/topic/73391-solved-running-php-from-command-line-issues/#findComment-370276 Share on other sites More sharing options...
dfound Posted October 16, 2007 Author Share Posted October 16, 2007 Thank you very much... EXACTLY what I was looking for. Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/73391-solved-running-php-from-command-line-issues/#findComment-370678 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.