2013-07-24 11 views
9

Sono riuscito a installare correttamente PHP-FPM utilizzando homebrew.Arresto di "php-fpm" (installazione homebrew) Mac OSX 10.8.2

Ho persino configurato il mio nginx.conf per funzionare. Tuttavia, ogni volta che faccio nel terminale:

$: php-fpm 

ottengo l'errore:

[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 

Tuttavia, la mia nginx sta lavorando bene.

Ecco il nginx.conf in base all'esecuzione di Yii.

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; 
     } 
    } 

Non riesco a stop il php-fpm. Ho bisogno di fermarlo come ho modificato il php.ini un po '. Qual è il metodo per farlo ??

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

Dove sto andando male?

Anche quando sto scrivendo: php-fpm -v sto ottenendo:

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 

Tuttavia, si sta mostrando il vecchio php-FPM, come avevo installato 5.4.

saluti,

risposta

3

ho capito:

Il metodo per farlo è stato il seguente:

1. Cassa php-FPM, uso:

php-fpm php54-fpm 

2. Per interrompere il servizio, dobbiamo utilizzare SystemStarter di Apple, in questo modo:

SystemStarter php54-fpm restart 
+0

non funziona .. puoi spiegare – debuggerpk

+0

Cosa è esattamente che non hai capito? 1o o il secondo? –

+3

SystemStarter non esiste più – naomik

5

Apple dice: "The SystemStarter utility is deprecated."

Ma ho trovato un altro grande soluzione:

  1. mettere questo in ~/Library// LaunchDaemons: https://github.com/tarnfeld/osx-stack/blob/master/LaunchDaemons/org.php-fpm.plist

  2. percorsi cambiamento in questo plist file secondo i tuoi percorsi (es il mio eseguibile php-fpm è in/usr/sbin invece di/usr/local/sbin)

  3. Inserire il seguente in un nuovo file in/usr/sbin/o/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 

assicurarsi che directory è nel tuo $ PATH

Ora si può chiamare 'php-restart' per riavviare php-fpm

(Grazie a another post)

+0

'/ Users/' può essere sostituito da '~'. Quindi '/ Users//Library'è uguale a' ~/Library' – Maxime

0

Se si utilizza Mac, è possibile eseguire il checkout di php-fpm è in esecuzione?

è possibile utilizzare questo comando: php-fpm -t

Ora, è possibile vedere la domanda! E come risolvere da questo errore informazioni in la riga di comando!

Problemi correlati