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

 

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

plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

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

version='1.0'>

Labelcom.phpcgi

ProgramArguments

/opt/local/bin/php-cgi

-q

-b

127.0.0.1:900

Debug

Disabled

OnDemand

 

 

 

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

 

 

你可能感兴趣的:(php,mac)