How PHP runs in cpanel using the fast-cgi mode configuration method

Source: Internet
Author: User
Tags cpanel
    1. # Fastcgi configuration for PHP5
    2. LoadModule Fcgid_module modules/mod_fcgid.so
    3. Maxrequestsperprocess 15
    4. Maxrequestlen 15728640
    5. Processlifetime 120
    6. IdleTimeout 30
    7. Defaultminclassprocesscount 0
    8. Defaultmaxclassprocesscount 3
    9. Ipcconnecttimeout 60
    10. Ipccommtimeout 30
    11. AddHandler fcgid-script. php5. PhP4. 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
Copy Code

# End of autogenerated PHP configuration.

Once saved, restart Apache.

4. Because a large number of PHP processes occupy memory for a long time, the PHP process can be emptied once per hour. CRONTAB-E the cursor to the bottom 0 * * * * PS aux | grep php | Egrep-v grep | awk ' {print $} ' | Xargs Kill-9ctrl+o Save, Enter,ctrl+x exit

For the 3rd step, another foreigner summed up other methods: Login Whm->apache configuration->include editor->pre Virtual host Include

In particular, the following are:-Defaultminclassprocesscount 0 (necessary to make Idle timeout work)-threadstacksize (default was too high, wastes memory, the setting below is good for most and would 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. Maxrequestsperprocess 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. Busytimeout 120
    20. Busyscaninterval 90
    21. Errorscaninterval 60
    22. Zombiescaninterval 3
    23. Processlifetime 120
Copy Code
  • 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.