I have a page that adds items to a DB table and creates a new txt file with those items. It works fine when I run it manually but when it runs as a CRON in Plesk I get
PHP Warning: fopen(file.txt): failed to open stream: Permission denied
PHP Warning: fwrite(): supplied argument is not a valid stream resource
the cron is running under the domain in Plesk, not the Server and the syntax is:
/usr/bin/php -f /var/www/vhosts/*.com/subdomains/dev/httpdocs/crons/file.php
When the cron runs and gets the errors it still adds the items to the DB table but, obviously, doesn't creates the txt file. Any ideas?