1

I recently installed PHP 5.3.8 from source distribution on Ubuntu 11.04.

Here's the first parts of my configure directive:

./configure --enable-fpm --with-fpm-user=php-fpm 
--with-fpm-group=php-fpm --prefix=/usr/local/php-5.3.8 
--exec-prefix=/usr/local/php-5.3.8 
--with-config-file-path=/usr/local/php-5.3.8/etc 
--with-config-file-scan-dir=/usr/local/php-5.3.8/etc

Afterwards, I downloaded a sample for the shell script file that I used for /etc/init.d/php-fpm. I got the script from here: http://svn.php.net/repository/php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in. I edited the file and added the paths to relevant locations and then I copied the contents to /etc/init.d/php-fpm.

I chmod +x php-fpm and then attempt to start it with ./php-fpm start and I get the following error:

Starting php-fpm [07-Sep-2011 02:55:34] ERROR: bind() for address '127.0.0.1:9000' failed: Address already in use (98)

I changed the listening port number in php-fpm.conf and I still get the same error.

One thing I noticed is that there doesn't seem to have been a php.ini file created. I've looked everywhere for it under my prefix php directory and other places. I'm not sure if this is what is causing the problem.

I'd appreciate any guidance on how I can get PHP working.

Thanks.

EDIT: This is what I get when I use the command: lsof -i -P

sshd     2267    root    3u  IPv4   3188      0t0  TCP *:22 (LISTEN)
sshd     2267    root    4u  IPv6   3190      0t0  TCP *:22 (LISTEN)
sshd    12342    root    3r  IPv4 408697      0t0  TCP WorbServer1:22->41.206.11.43.vgccl.net:30961 (ESTABLISHED)
php-fpm 12485    root    6u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12486 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12487 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12488 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12489 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12490 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12491 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12492 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12493 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12494 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12495 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12496 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12497 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12498 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12499 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12500 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12501 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12502 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12503 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12504 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)
php-fpm 12505 php-fpm    0u  IPv4 409587      0t0  TCP localhost:9000 (LISTEN)

I'm not sure why they are so many though, I'll have to look at the php-fpm.conf.

2 Answers 2

0

Well, the simplest explanation to the port being in use would be that the port is, in fact, in use.

What do you get from lsof -i -P?

3
  • Lol, I figured that much but I had no idea what to do about it. Here's the last few results from lsof: php-fpm 11859 php-fpm 0u IPv4 398087 0t0 TCP localhost:9500 (LISTEN) php-fpm 11860 php-fpm 0u IPv4 398087 0t0 TCP localhost:9500 (LISTEN) php-fpm 11861 php-fpm 0u IPv4 398087 0t0 TCP localhost:9500 (LISTEN) sshd 12342 root 3r IPv4 408697 0t0 TCP WorbServer1:22->41.206.11.43.vgccl.net:30961 (ESTABLISHED)
    – Obi Hill
    Sep 7, 2011 at 11:42
  • so why is this the correct answer?
    – GusDeCooL
    Apr 26, 2016 at 3:00
  • why is this the correct answer?
    – Jose
    Apr 28, 2020 at 14:01
2

You can also use

fuser 9000/tcp

That will list all the pids running on that port.. easy way to kill them all

fuser -k 9000/tcp
2
  • fuser doesn't seem to be on my system for some reason (I'm using a Rackspace Cloud Server with Ubuntu 11.04). I intuitively tried apt-get install fuser but that didn't work.
    – Obi Hill
    Sep 7, 2011 at 11:57
  • +100 Works like a charm
    – Radek
    Jan 23, 2012 at 23:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .