0

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)?

djdy
  • 583
  • 2
  • 4
  • 15

2 Answers2

1
  • 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
Guillaume
  • 26
  • 1
0

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.

mschuett
  • 3,146
  • 21
  • 21