我已成功使用自制程序成功安装PHP-FPM.
我甚至配置了我的nginx.conf工作.但是,每当我在终端上做的时候:
$: php-fpm
Run Code Online (Sandbox Code Playgroud)
我收到错误:
[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
Run Code Online (Sandbox Code Playgroud)
但是,我的nginx运行正常.
根据运行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;
}
}
Run Code Online (Sandbox Code Playgroud)
我也无法stop使用php-fpm.我需要停止它,因为我已经修改了php.ini一点点.做什么方法?
service php-fpm restart
-bash: service: command not found
Run Code Online (Sandbox Code Playgroud)
我哪里错了?
即使我正在打字: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
Run Code Online (Sandbox Code Playgroud)
但是,它显示了旧的php-fpm,因为我安装了5.4.
问候,
col*_*ner 57
我使用本指南进行设置:https: //echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew
而这个命令重启我的php-fpm:
brew services restart php56
Run Code Online (Sandbox Code Playgroud)
如果您没有brew服务,请尝试像这样安装:
brew tap homebrew/services
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!
Apple表示:"SystemStarter实用程序已被弃用."
但是我发现了另一个很好的解
将这个在〜/库/ LaunchDaemons /:https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist
根据您的路径更改此plist文件中的路径(例如,我的php-fpm可执行文件位于/ usr/sbin而不是/ 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
Run Code Online (Sandbox Code Playgroud)
确保该目录在$ PATH中
现在你可以调用'php-restart'来重启php-fpm
(感谢另一篇文章)
我得到了它 :
方法如下:
1. 要签出 php-fpm,请使用:
php-fpm php54-fpm
Run Code Online (Sandbox Code Playgroud)
2. 要停止该服务,我们必须使用 Apple 的 SystemStarter,如下所示:
SystemStarter php54-fpm restart
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
63328 次 |
| 最近记录: |