mac下php(fastcgi)使用


sudo
 port install php5 +fastcgi fcgi

 

sudo port install php5-mysql php5-pgsql php5-iconv php5-sockets php5-memcached php5-imagick php5-mongo php5-openssl php5-mbstring

 

一般mac守護進程都放在

 

 ~/Library/LaunchAgents         Per-user agents provided by the user.
  /Library/LaunchAgents          Per-user agents provided by the administrator.   
  /Library/LaunchDaemons         System-wide daemons provided by the administrator.  //我把plist放在這裏
  /System/Library/LaunchAgents   Per-user agents provided by Mac OS X.
  /System/Library/LaunchDaemons  System-wide daemons provided by Mac OS X.

 

 

phpcgiserver-start:

vim com.phpcgi.plist

 

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >

<plist version='1.0'>

<dict>

<key>Label</key><string>com.phpcgi</string>

<key>ProgramArguments</key>

<array>

<string>/opt/local/bin/php-cgi</string>

<string>-q</string>

<string>-b</string>

<string>127.0.0.1:900</string>

</array>

<key>Debug</key><false/>

<key>Disabled</key><true/>

<key>OnDemand</key><false/>

</dict>

</plist>

 

 

 

sudo launchctl load -w /Library/LaunchDaemons/com.phpcgi.plist

sudo reboot//重啓電腦,以後phpcgi自動啓動,開啓一個進程數

 

參考:http://wiki.summercode.ru/wiki/wiki/Installing_nginx_and_PHP_with_FastCGI_on_Mac_OS_X_105

 

 

發佈了30 篇原創文章 · 獲贊 5 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章