• We value your experience with Plesk during 2025
    Plesk strives to perform even better in 2026. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2025.
    Please take this short survey:

    https://survey.webpros.com/

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