• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Create a cron job to execute a php script using php

dfutura

Basic Pleskian
I need to create a cron job or something similar with a php script. I try to create a file usingh php in etc/crontab like this:

$archivo = '/var/cron.d/pruebaCronMandaMail';
$fp = fopen($archivo, "a");
$string = "/usr/bin/php -q /var/www/vhosts/domain.com/httpdocs/createCronScript.php";
$write = fputs($fp, $string);
print_r($write);
fclose($fp);

But with apache user i cant create this file.

How can i do?
 
Back
Top