Type mod_php (DSO)
mod_php + mod_ruid2 mod_php + MPM_ITK mod_cgi
mod_suPHP mod_fcgid PHP-FPM LiteSpeed
Security Bad
Questionable Questionable Good Good Good Good Good
Performance Excellent Excellent Excellent OK OK
Excellent Excellent Excellent
Stability Bad Bad OK
Excellent Excellent Flaky ?
Excellent
Memory Footprint
Low Low OK OK OK
High High OK
mod_php (DSO)
Many dedicated servers run PHP as an Apache module as their default. Yet once you move the setup to the shared server, security breaks down. The major issue with shared hosting is there are multiple users running code on your servers not audited by your staff. This means you have to make sure that one user cannot snoop into or modify the data of another user.
However, because mod_php is an Apache module, all PHP scripts inherit Apache permissions. This means any protection that would usually be granted by UNIX user permissions does not work. Any file that can be read by Apache can be read by a customer’s PHP script. With that, attackers can pick up MySQL passwords for another user, which would let hackers steal confidential information, deface websites, and inject malware. The issue is made worse by the fact that scripts and programs executed by the PHP script also run with Apache permissions. Even if there is some hope that PHP sand boxing would stop malicious PHP script from opening other users’ files, once PHP script can execute a program, that program can do pretty much anything.
To combat that issue, PHP has the safe_mode, open_basedir directive, and ability to forbid some PHP functions, such as functions that are used to execute scripts. Yet even with such safeguards, it is very hard to protect against all possible attacks. While we can expect the PHP core to be fairly secure, the large number of extensions that are shipped with PHP may have their own security vulnerabilities, making such a setup fairly easy to exploit.
This is probably one of the reasons the PHP team gave up on safe_mode altogether in PHP 5.4.
“
The PHP safe mode is an attempt to solve the shared- server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren’t very realistic, many people, especially ISPs, use safe mode for now.
php.net 025
“
Page 1 |
Page 2 |
Page 3 |
Page 4 |
Page 5 |
Page 6 |
Page 7 |
Page 8 |
Page 9 |
Page 10 |
Page 11 |
Page 12 |
Page 13 |
Page 14 |
Page 15 |
Page 16 |
Page 17 |
Page 18 |
Page 19 |
Page 20 |
Page 21 |
Page 22 |
Page 23 |
Page 24 |
Page 25 |
Page 26 |
Page 27 |
Page 28 |
Page 29 |
Page 30 |
Page 31 |
Page 32 |
Page 33 |
Page 34 |
Page 35 |
Page 36 |
Page 37 |
Page 38 |
Page 39 |
Page 40 |
Page 41 |
Page 42 |
Page 43 |
Page 44 |
Page 45 |
Page 46 |
Page 47 |
Page 48 |
Page 49 |
Page 50 |
Page 51 |
Page 52 |
Page 53 |
Page 54 |
Page 55 |
Page 56 |
Page 57 |
Page 58 |
Page 59 |
Page 60 |
Page 61 |
Page 62 |
Page 63 |
Page 64 |
Page 65 |
Page 66 |
Page 67 |
Page 68