- Where Developers Learn, Share, & Build Careers
A php file (e.g. example.php) should write something in another file (say alma.txt). If example.php cron is run through the job, then everything is fine, but when I call it through the browser, it does not write alma.txt. Cron job runs a cron job under the owner of the crontab file that configures. Why?
When you run your PHP with a Crown Daemon, Is executing the command.
When you run your php script through the browser, this script has been executed by the user in the Web server that started the Apache process. For example, Ubuntu has a www-data user.
This file looks like a permission problem. Just allow the file alma.txt to make sure.
chmod 777 alma.txt and try again, if everything was okay, then there was a permission issue, and for the file I Suggesting setting correct permissions Probably add the www-data to the group in the file and give it to 775.
Comments
Post a Comment