Welcome! Log In Create A New Profile

Advanced

php-fpm start|stop|restart problem

Posted by alexd 
alexd
php-fpm start|stop|restart problem
January 10, 2010 10:30AM
Hi,

New to the group - having been using Nginx + spawn-fcgi for some time,
I'm now trying to catch up and get php-fpm working! I've followed the
instructions for the PHP core installation (as listed on
http://php-fpm.org/download/) and successfully compiled PHP with --
enable-fpm.

However, when I try sudo php-fpm start I get a PHP error message:

Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-
y <file>]
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
....

If on the other hand I try this: sudo php-fpm --fpm-config=/etc/php-
fpm.conf

then I don't get any stdout feedback BUT Nginx starts serving PHP and
ps -ef | grep fpm gives me:

root 4241 1 0 15:02 ? 00:00:00 php-fpm --fpm-config=/
etc/php-fpm.conf
www-data 4242 4241 0 15:02 ? 00:00:00 php-fpm --fpm-config=/
etc/php-fpm.conf
.... + 49 more workers

Obviously this isn't ideal as I want the proper start/stop/restart
functionality. Any help on how to get php-fpm start|stop|restart|etc
working as it should would be greatly appreciated!

Thanks very much,

Alex
Re: php-fpm start|stop|restart problem
January 10, 2010 06:06PM
I just do

ln -s /usr/local/sbin/php-fpm /etc/init.d/php-fpm
update-rc.d -f php-fpm remove
update-rc.d -f php-fpm defaults

on Ubuntu or Debian based seems to work...

On Sun, Jan 10, 2010 at 7:21 AM, alexd <alexander.dean@gmail.com> wrote:
> Hi,
>
> New to the group - having been using Nginx + spawn-fcgi for some time,
> I'm now trying to catch up and get php-fpm working! I've followed the
> instructions for the PHP core installation (as listed on
> http://php-fpm.org/download/) and successfully compiled PHP with --
> enable-fpm.
>
> However, when I try sudo php-fpm start I get a PHP error message:
>
> Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-
> y <file>]
>  -c <path>|<file> Look for php.ini file in this directory
>  -n               No php.ini file will be used
>  -d foo[=bar]     Define INI entry foo with value 'bar'
>  -e               Generate extended information for debugger/profiler
> ...
>
> If on the other hand I try this: sudo php-fpm --fpm-config=/etc/php-
> fpm.conf
>
> then I don't get any stdout feedback BUT Nginx starts serving PHP and
> ps -ef | grep fpm gives me:
>
> root      4241     1  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> etc/php-fpm.conf
> www-data  4242  4241  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> etc/php-fpm.conf
> ... + 49 more workers
>
> Obviously this isn't ideal as I want the proper start/stop/restart
> functionality. Any help on how to get php-fpm start|stop|restart|etc
> working as it should would be greatly appreciated!
>
> Thanks very much,
>
> Alex
>
alexd
Re: php-fpm start|stop|restart problem
January 10, 2010 06:30PM
Thanks Michael, I tried what you suggested (on Debian Lenny) but no
joy (no errors running your commands but same usage error on trying
"sudo php-fpm start").

Basically my problem isn't with adding the service for bootup, it's
with the actual functionality of php-fpm itself. It doesn't seem to
accept the start|stop|etc arguments that it's meant to.

Any ideas anyone?

Thanks,

Alex

On Jan 10, 11:04 pm, Michael Shadle <mike...@gmail.com> wrote:
> I just do
>
> ln -s /usr/local/sbin/php-fpm /etc/init.d/php-fpm
> update-rc.d -f php-fpm remove
> update-rc.d -f php-fpm defaults
>
> on Ubuntu or Debian based seems to work...
>
> On Sun, Jan 10, 2010 at 7:21 AM, alexd <alexander.d...@gmail.com> wrote:
> > Hi,
>
> > New to the group - having been using Nginx + spawn-fcgi for some time,
> > I'm now trying to catch up and get php-fpm working! I've followed the
> > instructions for the PHP core installation (as listed on
> >http://php-fpm.org/download/) and successfully compiled PHP with --
> > enable-fpm.
>
> > However, when I try sudo php-fpm start I get a PHP error message:
>
> > Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-
> > y <file>]
> >  -c <path>|<file> Look for php.ini file in this directory
> >  -n               No php.ini file will be used
> >  -d foo[=bar]     Define INI entry foo with value 'bar'
> >  -e               Generate extended information for debugger/profiler
> > ...
>
> > If on the other hand I try this: sudo php-fpm --fpm-config=/etc/php-
> > fpm.conf
>
> > then I don't get any stdout feedback BUT Nginx starts serving PHP and
> > ps -ef | grep fpm gives me:
>
> > root      4241     1  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> > etc/php-fpm.conf
> > www-data  4242  4241  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> > etc/php-fpm.conf
> > ... + 49 more workers
>
> > Obviously this isn't ideal as I want the proper start/stop/restart
> > functionality. Any help on how to get php-fpm start|stop|restart|etc
> > working as it should would be greatly appreciated!
>
> > Thanks very much,
>
> > Alex
>
>
Re: php-fpm start|stop|restart problem
January 10, 2010 06:48PM
what version of php-fpm are you using? the patch? the launchpad version?

On Sun, Jan 10, 2010 at 3:27 PM, alexd <alexander.dean@gmail.com> wrote:
> Thanks Michael, I tried what you suggested (on Debian Lenny) but no
> joy (no errors running your commands but same usage error on trying
> "sudo php-fpm start").
>
> Basically my problem isn't with adding the service for bootup, it's
> with the actual functionality of php-fpm itself. It doesn't seem to
> accept the start|stop|etc arguments that it's meant to.
>
> Any ideas anyone?
>
> Thanks,
>
> Alex
>
> On Jan 10, 11:04 pm, Michael Shadle <mike...@gmail.com> wrote:
>> I just do
>>
>> ln -s /usr/local/sbin/php-fpm /etc/init.d/php-fpm
>> update-rc.d -f php-fpm remove
>> update-rc.d -f php-fpm defaults
>>
>> on Ubuntu or Debian based seems to work...
>>
>> On Sun, Jan 10, 2010 at 7:21 AM, alexd <alexander.d...@gmail.com> wrote:
>> > Hi,
>>
>> > New to the group - having been using Nginx + spawn-fcgi for some time,
>> > I'm now trying to catch up and get php-fpm working! I've followed the
>> > instructions for the PHP core installation (as listed on
>> >http://php-fpm.org/download/) and successfully compiled PHP with --
>> > enable-fpm.
>>
>> > However, when I try sudo php-fpm start I get a PHP error message:
>>
>> > Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-
>> > y <file>]
>> >  -c <path>|<file> Look for php.ini file in this directory
>> >  -n               No php.ini file will be used
>> >  -d foo[=bar]     Define INI entry foo with value 'bar'
>> >  -e               Generate extended information for debugger/profiler
>> > ...
>>
>> > If on the other hand I try this: sudo php-fpm --fpm-config=/etc/php-
>> > fpm.conf
>>
>> > then I don't get any stdout feedback BUT Nginx starts serving PHP and
>> > ps -ef | grep fpm gives me:
>>
>> > root      4241     1  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
>> > etc/php-fpm.conf
>> > www-data  4242  4241  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
>> > etc/php-fpm.conf
>> > ... + 49 more workers
>>
>> > Obviously this isn't ideal as I want the proper start/stop/restart
>> > functionality. Any help on how to get php-fpm start|stop|restart|etc
>> > working as it should would be greatly appreciated!
>>
>> > Thanks very much,
>>
>> > Alex
>>
>>
>
alexd
Re: php-fpm start|stop|restart problem
January 10, 2010 07:18PM
I'm using the version in PHP core based off of the 0.6.x series in
Launchpad. I got it by running the following checkout yesterday:

svn co http://svn.php.net/repository/php/php-src/branches/PHP_5_3_FPM

Thanks,

Alex

On Jan 10, 11:46 pm, Michael Shadle <mike...@gmail.com> wrote:
> what version of php-fpm are you using? the patch? the launchpad version?
>
> On Sun, Jan 10, 2010 at 3:27 PM, alexd <alexander.d...@gmail.com> wrote:
> > Thanks Michael, I tried what you suggested (on Debian Lenny) but no
> > joy (no errors running your commands but same usage error on trying
> > "sudo php-fpm start").
>
> > Basically my problem isn't with adding the service for bootup, it's
> > with the actual functionality of php-fpm itself. It doesn't seem to
> > accept the start|stop|etc arguments that it's meant to.
>
> > Any ideas anyone?
>
> > Thanks,
>
> > Alex
>
> > On Jan 10, 11:04 pm, Michael Shadle <mike...@gmail.com> wrote:
> >> I just do
>
> >> ln -s /usr/local/sbin/php-fpm /etc/init.d/php-fpm
> >> update-rc.d -f php-fpm remove
> >> update-rc.d -f php-fpm defaults
>
> >> on Ubuntu or Debian based seems to work...
>
> >> On Sun, Jan 10, 2010 at 7:21 AM, alexd <alexander.d...@gmail.com> wrote:
> >> > Hi,
>
> >> > New to the group - having been using Nginx + spawn-fcgi for some time,
> >> > I'm now trying to catch up and get php-fpm working! I've followed the
> >> > instructions for the PHP core installation (as listed on
> >> >http://php-fpm.org/download/) and successfully compiled PHP with --
> >> > enable-fpm.
>
> >> > However, when I try sudo php-fpm start I get a PHP error message:
>
> >> > Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-
> >> > y <file>]
> >> >  -c <path>|<file> Look for php.ini file in this directory
> >> >  -n               No php.ini file will be used
> >> >  -d foo[=bar]     Define INI entry foo with value 'bar'
> >> >  -e               Generate extended information for debugger/profiler
> >> > ...
>
> >> > If on the other hand I try this: sudo php-fpm --fpm-config=/etc/php-
> >> > fpm.conf
>
> >> > then I don't get any stdout feedback BUT Nginx starts serving PHP and
> >> > ps -ef | grep fpm gives me:
>
> >> > root      4241     1  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> >> > etc/php-fpm.conf
> >> > www-data  4242  4241  0 15:02 ?        00:00:00 php-fpm --fpm-config=/
> >> > etc/php-fpm.conf
> >> > ... + 49 more workers
>
> >> > Obviously this isn't ideal as I want the proper start/stop/restart
> >> > functionality. Any help on how to get php-fpm start|stop|restart|etc
> >> > working as it should would be greatly appreciated!
>
> >> > Thanks very much,
>
> >> > Alex
>
>
Oleg Roschupkin
Re: php-fpm start|stop|restart problem
January 10, 2010 08:42PM
10.01.2010, в 23:21, alexd написал(а):

> However, when I try sudo php-fpm start I get a PHP error message:

Recently the same was in http://groups.google.com/group/highload-php-en/browse_thread/thread/f794c6e667a658dc

Try "/sapi/fpm/init.d.php-fpm" script

--
Yours, Oleg Roschupkin
jjahson@gmail.com
Gordon Pettey
Re: php-fpm start|stop|restart problem
January 11, 2010 12:02PM
On Sun, Jan 10, 2010 at 5:27 PM, alexd <alexander.dean@gmail.com> wrote:
> Basically my problem isn't with adding the service for bootup, it's
> with the actual functionality of php-fpm itself. It doesn't seem to
> accept the start|stop|etc arguments that it's meant to.
>
> Any ideas anyone?
>
> Thanks,
>
> Alex

You don't use start/stop/reload on the binary, that's what the init.d
is for (/etc/init.d/php-fpm start, /etc/init.d/php-fpm reload,
/etc/init.d/php-fpm stop). Use kill with SIGTERM, SIGQUIT, SIGUSR2 for
stop, graceful stop, and graceful reload without the init.d.
alexd
Re: php-fpm start|stop|restart problem
January 16, 2010 09:46PM
Just wanted to thank Oleg and Gordon for their help.

In case anyone else wants to know exactly how to get the startup
script working, I reproduce my steps below...

---

First deploy the startup script:

sudo cp ~/sources/php_5_3_fpm/sapi/fpm/init.d.php-fpm /etc/init.d/php-
fpm
sudo chmod a+x /etc/init.d/php-fpm

Now edit the file:

sudo nano /etc/init.d/php-fpm

And edit the top lines to look like this:

prefix=/usr/local
exec_prefix=${prefix}/sbin

php_fpm_BIN=${exec_prefix}/php-fpm
php_fpm_CONF=/etc/php/php-fpm.conf
php_fpm_PID=${prefix}/var/run/php-fpm.pid

Now add the script to your run levels:

sudo update-rc.d -f php-fpm remove
sudo update-rc.d -f php-fpm defaults

---

Cheers,

Alex

On Jan 11, 5:01 pm, Gordon Pettey <petteyg...@gmail.com> wrote:
> On Sun, Jan 10, 2010 at 5:27 PM, alexd <alexander.d...@gmail.com> wrote:
> > Basically my problem isn't with adding the service for bootup, it's
> > with the actual functionality of php-fpm itself. It doesn't seem to
> > accept the start|stop|etc arguments that it's meant to.
>
> > Any ideas anyone?
>
> > Thanks,
>
> > Alex
>
> You don't use start/stop/reload on the binary, that's what the init.d
> is for (/etc/init.d/php-fpm start, /etc/init.d/php-fpm reload,
> /etc/init.d/php-fpm stop). Use kill with SIGTERM, SIGQUIT, SIGUSR2 for
> stop, graceful stop, and graceful reload without the init.d.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 149
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready