Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Tips for Securing a LAMP Server

On a Linux based server, what are some of the best practices for securing PHP?

What functions should be disabled (ex. exec, exec_shell, system)?

share|improve this question

marked as duplicate by Iain, Scott Pack, mailq, voretaq7, MDMarra Nov 13 '11 at 17:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 1 down vote accepted
  • Use suhosin -
  • Run PHP in cgi/fastcgi mode
  • If multiple users are using your webserver, make sure each user's php-cgi processes are spawned under a different (unprivileged) uid/gid pair from its neighbour
share|improve this answer

mod_php is not a solution because all PHP processes run with the same UID and access rights.

I use suPHP for a shared server. That way all users have their own system accounts and every PHP process is run with their own UID. --> Pro: users have restricted access and are isolated from each other. Con: less performance because it is basically a CGI model.

Stuart Herbert had a blog series about on this and other PHP setup solutions.

share|improve this answer

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