Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:php:503-errors [2018/08/01 19:12]
Lisa Clarke [Strace the PHP process] Proofreading
litespeed_wiki:php:503-errors [2018/10/02 15:47]
Lisa Clarke [Misconfiguration of lsphp external application] Proofread
Line 239: Line 239:
 Check the PHP ''​max_execution_time''​ configuration in a phpinfo() page to see if it is set high enough to handle long running requests. ​ Check the PHP ''​max_execution_time''​ configuration in a phpinfo() page to see if it is set high enough to handle long running requests. ​
  
-====The lsphp process is killed unexpectedly by CSF/LFD ====+==== The lsphp process is killed unexpectedly by CSF/LFD ====
  
-When a php script is executing, if the process is killed by the admin or a process monitoring daemon, it'll result in 503 errors.+When a PHP script is executing, if the process is killed by the admin or a process monitoring daemon, it'll result in 503 errors.
  
 === CSF/LFD Kill === === CSF/LFD Kill ===
Line 255: Line 255:
   PT_USERTIME = "​1800"​   PT_USERTIME = "​1800"​
   ​   ​
-So if an lsphp5 process has run 1800 seconds (30 minutes), it might be caught by csf and killed. In php suExec ​Daemon mode or ProcessGroup mode, it's normal that the parent lsphp5 process keeps running after 30 minutes. When csf/lfd kills an lsphp5 process, it'll leave logs in ''/​var/​log/​lfd.log''​. These logs will look similar to the following:+So if an lsphp5 process has run 1800 seconds (30 minutes), it might be caught by csf and killed. In PHP Daemon mode or ProcessGroup mode, it's normal that the parent lsphp5 process keeps running after 30 minutes. When csf/lfd kills an lsphp5 process, it'll leave logs in ''/​var/​log/​lfd.log''​. These logs will look similar to the following:
  
   Jun 19 16:29:16 evo lfd[18304]: *User Processing* PID:18264 Kill:1 User:xxxxx VM:538(MB) EXE:/​usr/​local/​lsws/​fcgi-bin/​lsphp-5.4.42 CMD:lsphp5   Jun 19 16:29:16 evo lfd[18304]: *User Processing* PID:18264 Kill:1 User:xxxxx VM:538(MB) EXE:/​usr/​local/​lsws/​fcgi-bin/​lsphp-5.4.42 CMD:lsphp5
Line 290: Line 290:
 These settings will need to be adjusted on a per case basis as each scenario will be different. They should be increased slightly higher than the current values until the issue stops occurring. For the changes to take effect, both csf and lfd will need to be restarted. This can either be done via the WHM Plugin or through a shell terminal with the following command: ''​csf -r; service lfd restart''​ These settings will need to be adjusted on a per case basis as each scenario will be different. They should be increased slightly higher than the current values until the issue stops occurring. For the changes to take effect, both csf and lfd will need to be restarted. This can either be done via the WHM Plugin or through a shell terminal with the following command: ''​csf -r; service lfd restart''​
  
 +==== Misconfiguration of "​lsphp"​ External Application ====
 +During LiteSpeed Web Server installation,​ external applications will be automatically set to the best value for general use. However, sometimes the user intentionally removes some of these settings. This causes a misconfiguration and possibly also a 503 error.
 +
 +For a PHP external app, LSWS will normally add the following to it by default:
 +    <​memSoftLimit>​2047M</​memSoftLimit>​
 +    <​memHardLimit>​2047M</​memHardLimit>​
 +    <​procSoftLimit>​1400</​procSoftLimit>​
 +    <​procHardLimit>​1500</​procHardLimit>​
 +
 +Imagine a user intentionally removes the above without any clear purpose. When the resource limit is not set, LSWS will use the CGI resource limit by default, but the CGI resource limit is too low to meet the requirements. ​
 +
 +If the user has configured PHP to have 500 max connections:​
 +     <​maxConns>​500</​maxConns>​
 +
 +Then it must have 500 child processes: ​
 +     <​env>​PHP_LSAPI_CHILDREN=500</​env>​
 +
 +The "500 max connections"​ setting requires "​process limit" to be set at a minimum of "​1000."​ But since the user incorrectly removed the PHP process limit settings, the above misconfiguration caused a 503 PHP error when running LSWS. 
 +
 +We recommend that you do not to remove anything if you are unsure, as it can cause an uncertain problem, including a 503 error. ​
 ====  Apache and LiteSpeed using unmatched PHPs could cause problems for control panel users ====  ====  Apache and LiteSpeed using unmatched PHPs could cause problems for control panel users ==== 
 If you use a control panel such as cPanel or Plesk, make sure both PHPs for Apache and LiteSpeed are matching each other. To test this, you can create a phpinfo page under your domain and switch between both web servers to check. If these PHPs do not match you could end up with 503 errors. If you use a control panel such as cPanel or Plesk, make sure both PHPs for Apache and LiteSpeed are matching each other. To test this, you can create a phpinfo page under your domain and switch between both web servers to check. If these PHPs do not match you could end up with 503 errors.
Line 321: Line 341:
  
 ==== Magento 503 error ==== ==== Magento 503 error ====
-After (re)installation of LiteMage Cache extension in Magento Connect manager, Magento site couldn'​t be accessed and may give 503 errors. ​ Please refer [[litespeed_wiki:​cache:​litemage:​troubleshooting:​connect-cache-session-cleaning-error|this]] for details.+After (re)installation of LiteMage Cache extension in Magento Connect manager ​or enable other modules in Magento 2, Magento site may be placed in maintenancence mode and couldn'​t be accessed and may give 503 errors. ​ Please refer [[litespeed_wiki:​cache:​litemage:​troubleshooting:​connect-cache-session-cleaning-error|this]] for details.
  
  
  • Admin
  • Last modified: 2020/02/11 14:26
  • by Jackson Zhang