• 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

Plesk 11.5 Can't enable mod_php

chubba

New Pleskian
Hi All,

This has been doing my head in for over a day now. Got a Drupal 7 site on a new 11.5 server that is slow, giving the failures:

Code:
[Wed Feb 12 12:18:22 2014] [warn] [client X.X.X.X] mod_fcgid: read data timeout in 45 seconds
[Wed Feb 12 12:18:22 2014] [error] [client X.X.X.X] Premature end of script headers: index.php

All I want to do is to flag the domain to use the Apache Module rather than the fcgid one. So I go to Tools & Settings > Apache Web Server and the put a tick in php5 to use the module. I click back to the page again and the tick has gone from the box...

# ls /etc/httpd/modules/

Shows there is no mod_php or mod_php5 module there...

I have the option to Run PHP as Apache Module in the hosting settings for that domain but when I set it to this all I get is the php pages being downloaded by the browser when I view the site - as PHP isn't working.

Any ideas what is wrong here and what I can do to fix this?

Cheers,

chubba
 
OK, got there in the end. For anyone else suffering with the mod_fcgid: read data timeout in 45 seconds errors I hope this may be of some help...

As I said before, the PHP as an Apache Module was not working at all. When flagged as Apache Module httpd restart would barf, stating that

LoadModule php5_module modules/libphp5-zts.so

could not be loaded and the advice on a Parallels page was to comment out this line. Without this line PHP could not be activated as an Apache Module. I tracked down that I had enabled the EPEL repo when trying to install Denyhosts and a yum update had pulled down PHP 5.3.3 and this was the root of the problem with the Apache module.

I had done a:

# yum install php-zts

But this did not solve the problem... I considered how I could downgrade PHP or add another PHP version but looking at the other PHP versions it looks like you can't add another and use it as the Apache Module so that was out. I was sure I had enabled the atomic repos but on further inspection I hadn't. So:

# wget http://www.atomicorp.com/installers/atomic.sh
# chmod 777 atomic.sh
# ./atomic.sh
# yum update

This barfed on the php-zts but showed me that the PHP packages would be updated to 5.4.25 from the atomic repo - this could be good! So:

# yum remove php-zts
# yum update

And it updated PHP to 5.4.25. Result! Plesk worked OK, sites that were working before (a Drupal 6 installation and a few Wordpress sites) were all working fine. Went back to the Drupal 7 install - still running like a pig. Aaarrghhh!!

Swapped from Apache Module to FastCGI and still the same. Rebooted Apache, rebooted the machine, still running dog slow. As well as the built site that I was pushing on to the machine I also did an installation of Drupal from the Application Vault. While not as slow as the full site it certainly wasn't as nippy as it should be. For example drush cc all was taking two minutes to complete. On a site with no content! So decided to look in more detail here than concentrate on PHP itself.

I had some similar issues with a local bespoke site last year some time, application running much slower than it should. In this case swapping the main table that was being written to from Innodb to MyISAM fixed the problem and it ran like lightning. So a command line into MySQL and running:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`
use mydatabase;
show table status;

Showed that all tables were Innodb. Changed them all to MyISAM and the site ran like lightning! So there was the problem. mod_fcgid: read data timeout in 45 seconds errors were being caused due to slowness in MySQL when using InnoDB tables...

I tried the Percona MySQL tuner but the config was barfing on one line. Yes I was dumping the InnoDB log files when restarting but no config changes were working for me. Last night I updated the production site that was running on the server from InnoDB to MyISAM and the same happened as with the vanilla install - it started to run like a dream. drush cc all completes now in seconds and the site is as responsive as I would expect it to be on a server of this spec. It is a 1 and 1 L4Corei machine with 12GB RAM so should be a slouch.

I will start another thread to question the InnoDB / Drupal set up being so painful on Plesk when I have some time. I have only written this up in the hope that it will help others diagnose this issue a bit quicker as it took me almost two days to sort!
 
Back
Top