0

First off, I'm a huge linux noob - sorry... I'm trying to setup nginx with php-fpm on debian and I'm pretty sure that I've completely screwed it up. nginx seems to be running fine because I can it it from a web browser and it load the stock "Welcome to nginx!" page. I'm not so sure about php-fpm though. When I try something like

# restart php-fpm

I get:

bash: restart: command not found

First off php-fpm some how got installed as php5-fpm when I do root@server:/etc/init.d# ls, which seems to contradict every tutorial and help doc I've read (supposed to be 'php-fpm').

I can restart it with this:

service php5-fpm restart

And just enter the package name 'php5-fpm' I get this:

root@server:~# php5-fpm
[17-Nov-2012 23:15:36] NOTICE: PHP message: PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/suhosin.so' - /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0
[17-Nov-2012 23:15:36] ERROR: An another FPM instance seems to already listen on /var/run/php5-fpm.sock
[17-Nov-2012 23:15:36] ERROR: FPM initialization failed

The root for nginx is /usr/share/nginx/html, when I try to navigate to a .php file in there with my web browser, it tries to download the file instead of interpret it. I would like this folder to be in my user's home directory ie: /home/administrator/www or /home/nginx/www. I know in order to do this I need to modify nginx.conf, but I find that configuration file difficult to understand. I suppose the fact that my .php scripts aren't being handled is my bigger problem anyways.

When I try to see what running on port 9000 (php-fpm default port) with lsof -i :9000 it returns nothing - I guess indicating that it isn't listening. then I head over to vim /etc/php5/fpm/php-fpm.conf and there is no where to designate a port number.

  • So should I just uninstall everything and start from scratch? If so,
  • how do I clean it all up? Any suggestions for a tutorial once I'm
  • ready to try again? Should I attempt to troubleshoot this mess?
  • If so where should I start?

Sorry guys, I'm feeling pretty stupid and lost right now. I'm not sure what my next steps are in trying to resolve this issue are. I realize that this is a horrible question for this type of Q&A site, but I'd really appreciate any guidance.

jreed121
  • 129
  • 2
  • 8

1 Answers1

4

First of all, man saves your bacon. If you have tried man lsof, you'd eliminate one question.

Next, be attentive:

another FPM instance seems to already listen on /var/run/php5-fpm.sock

silently reminds you that it makes no sense to

try to see what running on port 9000

So should I just uninstall everything and start from scratch?

No, if you haven't encountered any installation errors.

how do I clean it all up?

You haven't done anything yet to clean up as far as I can see. Configure PHP-FPM && nginx.

Should I attempt to troubleshoot this mess?

That's a key to a solution! Use less /var/log/__yourlogfile__ every time you are in doubt.

If so where should I start?

  1. man command, mentioned before. Use it like man service; man php-fpm.
  2. lsof -U /var/run/php5-fpm.sock
  3. wiki.nginx.org/Configuration
  4. Use search better: Getting rid of "Welcome to nginx!" fits your question
  5. Read the Debian Reference
berezovskyi
  • 141
  • 2