因此,我从 MacPorts 以及 nginx 和 mysql 安装了 PHP5 FCGI。最后两个在系统启动期间加载正常。但是 PHP 没有。我创建了一个文件/opt/local/etc/LaunchDaemons/org.macports.php5/org.macports.php5-cgi.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>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/...
手动启动它。