cpanel中的php運行方式使用fast-cgi模式的配置方法

來源:互聯網
上載者:User
  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 .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.

儲存好之後,重啟apache。

4.由於大量php進程長期佔用記憶體,可以每小時執行一次清空php進程。crontab -e把游標弄到最下0 * * * * ps aux | grep php | egrep -v grep | awk ‘{print $2}’ | xargs kill -9Ctrl+O儲存,Enter,Ctrl+X退出

對於第3步,也另有老外總結出其它方法:登入 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. 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
複製代碼
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.