Symptoms
When using Apache + cPanel-provided LSAPI PHP handler, Apache fails to load PHP pages and the following error appears in Apache's error log:
[Wed Aug 11 13:16:58.919562 2021] [host domain.tld] connect_lsphp: connect to lsphp failed; tries 2/20; timeout 500000
[Wed Aug 11 13:16:58.919562 2021] [lsapi:notice] [pid 4648:tid 47622055991040] [client 185.191.171.19:44610] [host domain.tld] connect_lsphp: connect to lsphp failed; tries 16/20; timeout 500000
Description
This usually suggest that there are some permission/ownership issues with the script that is being executed. You can always run the following command to see all the permission/ownership modes for all the directories along the absolute path to the file and also the file itself:
namei -l /PATH/TO/THE/FILE
Workaround
Here is an example:
namei -l /home/cptest/public_html/index.php
f: /home/cptest/public_html/index.php
drwxrwxrwx root root /
drwx--x--x root root home
drwx--x--x cptest cptest cptest
drwxr-xr-x cptest cptest public_html
-rw-r--r-- root root index.php
As you can see the root file system has permission 777:
stat -c "%a %U %G" /
777 root root
This is incorrect and needs to be changed to 555:
chmod 555 /
Comments
0 comments
Article is closed for comments.