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.

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.

share|improve this question

closed as not a real question by Michael Hampton, Magellan, Jay, Ward, HopelessN00b Nov 19 '12 at 11:30

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Perhaps, if you don't know Linux, try it with an http server that has a less-steep learning curve? –  Magellan Nov 18 '12 at 20:54
add comment

1 Answer

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
share|improve this answer
add comment

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