Starting php-cgi at boot on mac os x 10.6.8
- by nikhil
I'm new to mac os, I have installed and configured nginx with php-fastcgi.
I need to run this command in a terminal and keep that terminal open to access php files from my browser.
php-cgi -b 127.0.0.1:9000 -q
Here's the plist that I wrote by looking up sources on the internet
<?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>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>nikhil</string>
<key>Label</key>
<string>php-fastcgi</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/php-cgi</string>
<string>-b 127.0.0.1:9000</string>
<string>-q</string>
</array>
</dict>
</plist>
I'm loading it using launchctl load -w ~/Library/LaunchAgents/php-fastcgi.plist without any success, can anyone tell me how this can be done.