Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在mac上自动启动php fpm_Php_Macos_Launchctl - Fatal编程技术网

如何在mac上自动启动php fpm

如何在mac上自动启动php fpm,php,macos,launchctl,Php,Macos,Launchctl,我想在我的mac(Yosemite10.10.5)上安装nginx和php。但是当我重新启动mac时,php fpm无法自动启动。 步骤1,通过brew安装nginx ==>如果成功,我可以访问 步骤2,设置nginx服务自动启动,如下所示 sudo chown root:wheel/usr/local/opt/nginx/bin/nginx sudo chmod u+s/usr/local/opt/nginx/bin/nginx mkdir -p ~/Library/LaunchAgents

我想在我的mac(Yosemite10.10.5)上安装nginx和php。但是当我重新启动mac时,php fpm无法自动启动。

步骤1,通过brew安装nginx

==>如果成功,我可以访问

步骤2,设置nginx服务自动启动,如下所示

sudo chown root:wheel/usr/local/opt/nginx/bin/nginx
sudo chmod u+s/usr/local/opt/nginx/bin/nginx
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/nginx/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
sudo chown root:wheel /usr/local/opt/php54/sbin/php-fpm
sudo chmod u+s /usr/local/opt/php54/sbin/php-fpm
cp /usr/local/opt/php54/homebrew.mxcl.php54.plist ~/Library/LaunchAgets
步骤3,测试自动启动功能,参见图

=>成功

步骤4,通过brew安装php5.4

=>成功

步骤4,设置php54自动启动,如下所示

sudo chown root:wheel/usr/local/opt/nginx/bin/nginx
sudo chmod u+s/usr/local/opt/nginx/bin/nginx
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/nginx/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
sudo chown root:wheel /usr/local/opt/php54/sbin/php-fpm
sudo chmod u+s /usr/local/opt/php54/sbin/php-fpm
cp /usr/local/opt/php54/homebrew.mxcl.php54.plist ~/Library/LaunchAgets
步骤5,测试自动启动功能

==>失败,什么也没发生。请看图片。

第六步,我想这是权限问题,所以我键入了follow和success

sudo launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
因此,我作为nginx执行了步骤4以避免权限问题,但结果失败。任何帮助都将不胜感激