Any idea what could cause a PHP file to execute fine in the browser, but give an error when run in the command line interface?
So to be specific, when I visit mysite.com/script.php in a browser, all is well.
When I execute php -f /var/www/mysite.com/public_html/script.php I get an error that one of my required files cannot be found.
So, the error message gives a lot of insight, but I am confused because it works as intended in the browser with no error, so I have no idea what could cause this behavior. Any ideas?
envto see yours. – waltinator Sep 07 '15 at 01:02PHP Warning: require(../php/cloudinary/Cloudinary.php): failed to open stream: No such file or directory in /var/www/mysite.com/public_html/script.php on line 7I looked at my process environment but didn't see anything off. And the error message is interesting, because the file obviously exists, as it works in browser and relies on the script its claiming isn't existent. – Zack Sep 07 '15 at 03:01../, which is relative to the current working directory of the process, therequirewill only work if you are in the right directory. If you have control of the script, change it to use the full, absolute path starting at/, – waltinator Sep 07 '15 at 05:34