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

WBOY
Freigeben: 2016-07-25 09:03:21
Original
1064 Leute haben es durchsucht
  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 -9 Ctrl+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
复制代码


Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!