因此,我從MacPorts以及nginx和mysql安裝了PHP5 FCGI。系統啓動時最後兩個加載正常。但PHP不。我創建了一個文件/opt/local/etc/LaunchDaemons/org.macports.php5/org.macports.php5-cgi.plist
,並把這個內容是:OS X:通過系統啓動時啓動自動啓動PHP FCGI
<?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>Label</key>
<string>org.macports.php5-cgi</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/php-cgi</string>
<string>-b127.0.0.1:9000</string>
<string>-q</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PHP_FCGI_CHILDREN</key>
<string>8</string>
<key>PHP_FCGI_MAX_REQUESTS</key>
<string>256</string>
</dict>
<key>Debug</key><false/>
<key>Disabled</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>
但它不會對負載啓動。 我需要執行sudo launchctl load -w /opt/...
才能手動啓動它。
謝謝你這個plist文件!很多教程顯示了「-b」和主機名和端口之間的空格。我的進程持續死亡,狀態爲255,直到我刪除了該空間。 – Matt