PHP running under mod_fcgid read data timeout in 40 seconds on Plesk

Running a PHP script under mod_fcgid was causing a 500 error to be returned.  The error logged was:

mod_fcgid: read data timeout in 40 seconds
(110)Connection timed out: mod_fcgid: ap_pass_brigade failed in handle_request function

There is a 40 second default on the script running.  To fix this for the requirement we needed to modify the vhosts.conf file for the Plesk domain and put in:

<IfModule mod_fcgid.c>
ProcessLifeTime 7200
IPCCommTimeout  7200
IPCConnectTimeout 300
</IfModule>

And rebuild the configuration file with: /usr/local/psa/admin/bin/websrvmng –reconfigure-vhost –vhost-name=domain

Cacti error on Plesk Ubuntu 6.06 server

OS: Ubuntu 6.06
Cacti 0.8.7e
Plesk 9

Setting up cacti went fine until trying to run the poller:

# sudo -u cacti /opt/psa/bin/php-cli /var/www/vhosts/hostname/httpdocs/poller.php
sh: /php-cli: No such file or directory
sh: /php-cli: No such file or directory
sh: /rrdtool: No such file or directory

Had to modify the php.ini (/etc/php5/cli/php.ini) for the php-cli binary:

;safe_mode = On
safe_mode = Off

The cacti poller did not like safe mode being enabled on CLI PHP binary.  After this was changed, cacti started polling properly.