自动启动 PHP-FPM

自动启动 PHP-FPM

我的 plist 文件

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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.php-fpm</string>
<key>ProgramArguments</key>
<array>
    <string>/opt/local/bin/daemondo</string>
    <string>--label=php-fpm</string>
    <string>--start-cmd</string>
    <string>/opt/local/sbin/php-fpm</string>
    <string>;</string>
    <string>--pid=fileauto</string>
    <string>--pidfile</string>
    <string>/opt/local/var/run/php-fpm/php-fpm.pid</string>
</array>
<key>Debug</key><false/>
<key>Disabled</key><true/>
<key>OnDemand</key><false/>
</dict>
</plist>

重启后,它不会自动加载。我仍然必须手动启动 php-fpm。我尝试过卸载并添加 RunAtLoad 等,但没有成功,并尝试了这两个 launchctl 命令。

sudo launchctl load -F /Library/LaunchDaemons/org.macports.php-fpm.plist
sudo launchctl load -w /Library/LaunchDaemons/org.macports.php-fpm.plist

答案1

尝试删除<key>Disabled</key><true/>并添加<key>RunAtLoad</key><true/>

相关内容