homebrew - 停止 "php-fpm"( Homebrew 安装)Mac OSX 10.8.2

标签 homebrew php

我已经成功使用 Homebrew 软件安装了 PHP-FPM。

我什至已经配置了我的 nginx.conf 来工作。但是,每当我在终端中执行操作时:

$: php-fpm

我收到错误:

[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

但是,我的 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;
        }
    }

我也无法停止 php-fpm。我需要停止它,因为我稍微修改了 php.ini。有什么方法可以实现吗?

service php-fpm restart
-bash: service: command not found

我哪里出错了?

即使我输入: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

但是,它显示的是旧的 php-fpm,因为我安装了 5.4。

最佳答案

我使用本指南进行设置: https://web.archive.org/web/20161220083008/https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew

这个命令可以重新启动我的 php-fpm:

brew services restart php56

如果您没有brew服务,请尝试按如下方式安装:

brew tap homebrew/services
<小时/>

在更现代的版本中,只需做

brew services start php
brew services stop php
brew services restart php

将启动、停止或重新启动 php-fpm 服务。

关于homebrew - 停止 "php-fpm"( Homebrew 安装)Mac OSX 10.8.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17837374/

相关文章:

homebrew - 在安装非标准 Homebrew 软件时安装 watchman

php - 多值插入复选框只有最后一个值正在进入数据库

php - 如何授予 PHP 对目录的写入权限?

ruby - 在 OS X Lion 上安装 OpenCV

javascript - 如何使用php和javascript在mysql中提交多行

php - 我应该如何清理仅在页面上使用的 _GET 变量?

php - xpath查找绝对路径有什么简单的方法吗?

node.js - 如何使用 Homebrew 降级或安装旧版本或特定版本的 Node ?

c++ - fatal error : 'openssl/conf.h' file not found

ruby - 系统更新后更新所有 RVM ruby 和 gem 的最佳方法?