Archive for March 6th, 2005

suphp?

Sunday, March 6th, 2005

suphp has been around for awhile now, but I do not understand why anyone would use it. On their page, it says:

Quote from suPHP Homepage:
suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

To me, it looks like a bad reimplementation of CGI and suEXEC. Their FAQ isn’t very helpful either. I took a quick look at the source code, and it doesn’t even use mod_cgi or mod_cgid to execute the actual process. mod_cgid does some neat tricks to avoid the overhead of forking when you have a multi-threaded server.

It doesn’t to have see any advantage over suEXEC. It is even possible to use mod_fcgid to run each FastCGI as a different user, and it would be signifigantly faster than suPHP. So, my question of the day is, Why would anyone use suPHP?

Eat Your Own Dog Food

Sunday, March 6th, 2005

This site is now running off the Event MPM, that I helped write.


I still have several sites that require PHP, so I am using mod_fcgid to run all of the remaining PHP Scripts via FastCGI.


Only the Until Uru Signup page had issues after the upgrade. This page was using the apache_add_output_filter function added by my apache2-filters patch for PHP. Since the PHP was no longer running inside apache, this function did not exist. The Until Uru templates are all built in XSLT, and the PHP was adding a XSLT Output Filter to process the XML it generates. To fix this, I modified the script send an extra header:

Quote from header.php:
header(”Content-Type: application/needs-xslt”);

I then told mod_transform to act on this:

Quote from httpd.conf:
AddOutputFilterByType XSLT application/needs-xslt

It seems everything else is working great. If anything is broken, please let me know.