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.

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
add comment

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.

2 Answers

up vote 1 down vote accepted
  • Use suhosin - http://www.hardened-php.net/
  • 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
add comment

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
add comment

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