我已经加载了 phpcgi.plist 但 php-fastcgi 没有运行。
plist文件是:
Michaels-MacBook-Pro:~ michael$ ll com*
-rwxr--r-- 1 michael admin 664 4 7 13:40 com.phpfcgi.plist*
plist XML:
Michaels-MacBook-Pro:~ michael$ cat com.phpfcgi.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PHP_FCGI_CHILDREN</key>
<string>2</string>
<key>PHP_FCGI_MAX_REQUESTS</key>
<string>1000</string>
</dict>
<key>Label</key>
<string>com.phpfcgi</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/php-cgi</string>
<string>-b 127.0.0.1:9000</string>
<string>-q</string>
</array>
<key>RunAtLoad</key>
<false/>
</dict>
</plist>
链接它:
Michaels-MacBook-Pro:~ michael$ ll Library/LaunchAgents/com.phpfcgi.plist
lrwxr-xr-x 1 michael admin 47 4 7 13:27 Library/LaunchAgents/com.phpfcgi.plist@ -> /Volumes/MainHD/Users/michael/com.phpfcgi.plist
我加载它:
Michaels-MacBook-Pro:~ michael$ launchctl load -w Library/LaunchAgents/com.phpfcgi.plist
com.phpfcgi: Already loaded
我检查一下:
Michaels-MacBook-Pro:~ michael$ ps -A | grep php
1110 ttys000 0:00.00 grep php
不工作。
但我可以通过运行启动 php fastcgi。
Michaels-MacBook-Pro:~ michael$ cat start_php-fastcgi
/usr/local/bin/php-cgi -q -b 127.0.0.1:9000 &