Install suPHP on CentOS 5.1

suPHP doesn't simply compile with ./configure like it used to in CentOS 4. This is because apr-config changed to apr-1-config.

Prerequisite:

yum install httpd-devel

Without httpd-devel installed you would receive this error: APXS was not found, so mod_suphp will not be built!

Step 1:

./configure --with-apr=/usr/bin/apr-1-config

Without the --with-apr=/usb/bin/apr-1-config you would receive this error: configure: error: APR is needed to build mod_suphp for Apache 2.x but was not found

Step 2:

make
sudo make install

Additional Information:
For suPHP 0.6.2 you should change src/apache2/mod_suphp.c lines 324 & 345 to:

AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"),

This will allow you to set the suPHP_AddHandler & suPHP_RemoveHandler from within a VirtualHost. (Download changed package)

Comments

THANK YOU SO MUCH FOR YOUR HELP! You are a life saver!

As an FYI:

/usb/bin/apr-1-config

--- should be: ---

/usr/bin/apr-1-config

Very useful, thanks!

Hi,
I’m getting the following errors

mod_suphp-0.7.1-1.el5.rf.i386 from dag has depsolving problems
–> Missing Dependency: httpd >= 2.0 is needed by package mod_suphp-0.7.1-1.el5.rf.i386 (dag)
mod_suphp-0.7.1-1.el5.rf.i386 from dag has depsolving problems
–> Missing Dependency: php is needed by package mod_suphp-0.7.1-1.el5.rf.i386 (dag)
Error: Missing Dependency: httpd >= 2.0 is needed by package mod_suphp-0.7.1-1.el5.rf.i386 (dag)
Error: Missing Dependency: php is needed by package mod_suphp-0.7.1-1.el5.rf.i386 (dag)

I have the latest Apache 2.2 and PHP5 on CentOS 5.5 and WHM.
I’m new to linux I think it has to do with the repos?