- 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

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -