Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

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?

share|improve this answer
    
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 '11 at 11:42
add comment

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
share|improve this answer
    
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 '11 at 11:57
    
+100 Works like a charm –  Radek Jan 23 '12 at 23:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.