How to configure the fast-cgi mode for running php in cpanel

Source: Internet
Author: User
Tags cpanel
How to configure the fast-cgi mode for running php in cpanel

  1. # Fastcgi configuration for PHP5
  2. LoadModule fcgid_module modules/mod_fcgid.so
  3. MaxRequestsPerProcess 15
  4. # MaxRequestLen 15728640
  5. Processlife 120
  6. IdleTimeout 30
  7. DefaultMinClassProcessCount 0
  8. DefaultMaxClassProcessCount 3
  9. IPCConnectTimeout 60
  10. IPCCommTimeout 30
  11. AddHandler fcgid-script. php5. php4. php. php3. php2. phtml
  12. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. php5
  13. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. php4
  14. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. php
  15. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. php3
  16. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. php2
  17. FCGIWrapper/usr/local/cpanel/cgi-sys/php5. phtml

# End of autogenerated PHP configuration.

After saving, restart apache.

4. because a large number of php processes occupy memory for a long time, the php process can be cleared once every hour. Crontab-e: Move the cursor down to 0 * ps aux | grep php | egrep-v grep | awk '{print $2}' | xargs kill-9 Ctrl + O save, enter, Ctrl + X exit

For step 1, other methods are also summarized by foreigners: log on to WHM-> Apache Configuration-> Include Editor-> Pre Virtual host Include

-DefaultMinClassProcessCount 0 (necessary to make Idle timeout work)-ThreadStackSize (default is too high, wastes memory, the setting below is good for most and will save enough memory to allow another php thread !)

  1. ThreadStackSize 4000000
  2. ServerLimit 2
  3. StartServers 1
  4. MaxClients 128
  5. MinSpareThreads 1
  6. MaxSpareThreads 1
  7. ThreadsPerChild 8
  8. MaxRequestsPerChild 700
  9. TimeOut 45
  10. Max requestsperprocess 500
  11. MaxProcessCount 15
  12. DefaultMaxClassProcessCount 15
  13. DefaultMinClassProcessCount 0
  14. IPCConnectTimeout 60
  15. IPCCommTimeout 3
  16. PHP_Fix_Pathinfo_Enable 1
  17. IdleTimeout 30
  18. IdleScanInterval 10
  19. Busytimeouts 120
  20. BusyScanInterval 90
  21. ErrorScanInterval 60
  22. ZombieScanInterval 3
  23. Processlife 120

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.