I have managed to successfully install PHP-FPM using homebrew.
我已经设法使用自制程序成功安装PHP-FPM。
I have even configured my nginx.conf to work. However, whenever I do in the terminal:
我甚至配置了我的nginx.conf工作。但是,每当我在终端上做的时候:
$: php-fpm
I get the error :
我收到错误:
[24-Jul-2013 19:58:34] ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)
[24-Jul-2013 19:58:34] ERROR: failed to load configuration file '/private/etc/php-fpm.conf'
[24-Jul-2013 19:58:34] ERROR: FPM initialization failed
However, my nginx is working fine.
但是,我的nginx运行正常。
Here is the nginx.conf according to running Yii.
根据运行Yii,这是nginx.conf。
server {
listen 80;
server_name campusplugin;
set $host_path "/var/www/campusplugin";
root $host_path;
set $yii_bootstrap "index.php";
charset utf-8;
#access_log logs/host.access.log main;
location / {
index index.html $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}
location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}
#avoid processing of calls to unexisting static files by yii
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
#let yii catch the calls to unexising PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}
root /var/www/campusplugin;
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
I am also not able to stop
the php-fpm. I need to stop it as I have modified the php.ini a little bit. What is the method to do it??
我也无法阻止php-fpm。我需要停止它,因为我已经修改了一些php.ini。这样做的方法是什么?
service php-fpm restart
-bash: service: command not found
Where am I going wrong?
我哪里错了?
Even when I am typing : php-fpm -v
I am getting :
即使我正在打字:php-fpm -v我得到:
php-fpm -v
PHP 5.3.15 (fpm-fcgi) (built: Aug 24 2012 17:45:59)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
However, it is showing the old php-fpm, as I had installed 5.4.
但是,它显示了旧的php-fpm,因为我安装了5.4。
Regards,
问候,
4 个解决方案
#1
45
I used this guide for my set up: https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
我使用本指南进行设置:https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
And this command to restart my php-fpm:
而这个命令重启我的php-fpm:
brew services restart php56
If you don't have brew services, try installing it like this:
如果您没有brew服务,请尝试像下面这样安装:
brew tap homebrew/services
Hope this helps!
希望这可以帮助!
#2
5
Apple says: "The SystemStarter utility is deprecated."
Apple称:“SystemStarter实用程序已被弃用。”
But I found another great solution:
但是我找到了另一个很好的解
-
Put this in ~/Library/LaunchDaemons/: https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist
把它放在〜/ Library / LaunchDaemons /:https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist
-
Change paths in this plist file according to your paths (e.g. my php-fpm executable is in /usr/sbin instead of /usr/local/sbin)
根据您的路径更改此plist文件中的路径(例如,我的php-fpm可执行文件位于/ usr / sbin而不是/ usr / local / sbin)
-
Put the following in a new file in /usr/sbin/ or /usr/local/sbin/
将以下内容放在/ usr / sbin /或/ usr / local / sbin /中的新文件中
.
。
/#!/bin/sh
echo "Stopping php-fpm..."
launchctl unload -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "Starting php-fpm..."
launchctl load -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "php-fpm restarted"
exit 0
make sure that directory is in your $PATH
确保该目录在$ PATH中
Now you can call 'php-restart' to restart php-fpm
现在你可以调用'php-restart'来重启php-fpm
(Thanks to another post)
(感谢另一篇文章)
#3
3
I got it :
我知道了 :
The method to do it was as follows :
这样做的方法如下:
1. To checkout php-fpm, use :
1.要结帐php-fpm,请使用:
php-fpm php54-fpm
2. To stop the service, we have to use Apple's SystemStarter, like so :
2.要停止服务,我们必须使用Apple的SystemStarter,如下所示:
SystemStarter php54-fpm restart
#4
0
If you use mac, You can checkout your php-fpm is running?
如果你使用mac,你可以检查你的php-fpm正在运行吗?
you can use this command: php-fpm -t
你可以使用这个命令:php-fpm -t
Now, You can see the question! And how to resolve by this error info in the command line!
现在,你可以看到这个问题!以及如何通过命令行中的此错误信息解决!
#1
45
I used this guide for my set up: https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
我使用本指南进行设置:https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
And this command to restart my php-fpm:
而这个命令重启我的php-fpm:
brew services restart php56
If you don't have brew services, try installing it like this:
如果您没有brew服务,请尝试像下面这样安装:
brew tap homebrew/services
Hope this helps!
希望这可以帮助!
#2
5
Apple says: "The SystemStarter utility is deprecated."
Apple称:“SystemStarter实用程序已被弃用。”
But I found another great solution:
但是我找到了另一个很好的解
-
Put this in ~/Library/LaunchDaemons/: https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist
把它放在〜/ Library / LaunchDaemons /:https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist
-
Change paths in this plist file according to your paths (e.g. my php-fpm executable is in /usr/sbin instead of /usr/local/sbin)
根据您的路径更改此plist文件中的路径(例如,我的php-fpm可执行文件位于/ usr / sbin而不是/ usr / local / sbin)
-
Put the following in a new file in /usr/sbin/ or /usr/local/sbin/
将以下内容放在/ usr / sbin /或/ usr / local / sbin /中的新文件中
.
。
/#!/bin/sh
echo "Stopping php-fpm..."
launchctl unload -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "Starting php-fpm..."
launchctl load -w /Users/<home-folder>/Library/LaunchDaemons/org.php-fpm.plist
echo "php-fpm restarted"
exit 0
make sure that directory is in your $PATH
确保该目录在$ PATH中
Now you can call 'php-restart' to restart php-fpm
现在你可以调用'php-restart'来重启php-fpm
(Thanks to another post)
(感谢另一篇文章)
#3
3
I got it :
我知道了 :
The method to do it was as follows :
这样做的方法如下:
1. To checkout php-fpm, use :
1.要结帐php-fpm,请使用:
php-fpm php54-fpm
2. To stop the service, we have to use Apple's SystemStarter, like so :
2.要停止服务,我们必须使用Apple的SystemStarter,如下所示:
SystemStarter php54-fpm restart
#4
0
If you use mac, You can checkout your php-fpm is running?
如果你使用mac,你可以检查你的php-fpm正在运行吗?
you can use this command: php-fpm -t
你可以使用这个命令:php-fpm -t
Now, You can see the question! And how to resolve by this error info in the command line!
现在,你可以看到这个问题!以及如何通过命令行中的此错误信息解决!