- Server operating system version
- AlmaLinux 9.7
- Plesk version and microupdate number
- Plesk 18.0.74
WE have a scheduled cronjobs which run
But these come back with an error because:
The code in the PHP file is:
The Standard Public Website files works correctly because the PHP in the "PHP" Plesk settings under "additional Directives" shows:
The class we need to use is placed in /usr/local/lib/php . How do we tell the PHP iteration that runs the Cronjob to load the "include_path" which works perfectly for the public facing PHP.
Documentation on this is obscured because the word "include" incorporates all the answers involving standard PHP script "include" function.
Cron <"account"@"server> (/opt/plesk/php/8.4/bin/php -f 'cronMailer/docuMailer.php') > /dev/null
But these come back with an error because:
PHP Warning: require(class.database.php): Failed to open stream: No such file or directory in /var/www/vhosts/account.co.uk/cronMailer/docuMailer.php on line 18
PHP Fatal error: Uncaught Error: Failed opening required 'class.database.php' (include_path='.:/opt/plesk/php/8.4/share/pear') in /var/www/vhosts/account.co.uk/cronMailer/docuMailer.php:18
The code in the PHP file is:
require class.database.php
The Standard Public Website files works correctly because the PHP in the "PHP" Plesk settings under "additional Directives" shows:
include_path = ".:/usr/local/lib/php"
open_basedir = {WEBSPACEROOT}{/}:/tmp/:/usr/local/lib/php/
The class we need to use is placed in /usr/local/lib/php . How do we tell the PHP iteration that runs the Cronjob to load the "include_path" which works perfectly for the public facing PHP.
Documentation on this is obscured because the word "include" incorporates all the answers involving standard PHP script "include" function.