How to install suPHP Setup on CentOS 6.x

Add RPM Forge repository.

32-bit:
rpm -ivH http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
64-bit:
rpm -ivH http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

Disable RPMForge by default (if you leave things like this enabled, it will break your system).

# sed -i ‘s/enabled = 1/enabled = 0/g’ /etc/yum.repos.d/rpmforge.repo
Install mod_suphp via yum:

Install suPHP

# yum install mod_suphp -y –enablerepo=rpmforge

Edit  PHP Handler:

sed -i ‘s/x-httpd-php=php:\/usr\/bin\/php/x-httpd-php=\”php:\/usr\/bin\/php-cgi\”/g’ /etc/suphp.conf

If you do not perform the above (replace “x-httpd-php=php:/usr/bin/php” with “x-httpd-php=”php:/usr/bin/php-cgi””) you will get the similar issues to the following errors:
[error] [client] SecurityException in Application.cpp:511: Unknown Interpreter: php
[error] [client] Premature end of script headers: index.php

 

Example vhost config (/etc/httpd/conf.d/example.com.conf

<VirtualHost ip-address:80>
NameVirtualHost example.com
ServerName example.com
ServerAlias www.example.com
ServerAdmin webmaster@example.com
DocumentRoot /path/to/web/document/root
ErrorLog /var/log/httpd/example.com-error_log
CustomLog /var/log/httpd/example.com-access_log combined
DirectoryIndex index.php index.html

suPHP_Engine on
suPHP_UserGroup user group
AddHandler x-httpd-php .php
suPHP_AddHandler x-httpd-php

<Directory />
AllowOverride All
</Directory>
</VirtualHost>

Hosting Ahead

Recent Posts

Run composer with different PHP version

If multiple PHP versions are installed on your server you need to tell the composer…

2 years ago

How to Install WordPress using WordPress Toolkit in cPanel

Wordpress toolkit allows the installation, configuration, and management of Wordpress. The first step is to…

3 years ago

Configure OpenVPN Client Devices for Andriod

These instructions cover installing and configuring the OpenVPN Connect app  Client-Side Configurations: Android There are…

3 years ago

The certificate chain was issued by an authority that is not trusted | SQL Server

This error may appear when you try to connect to Microsft SQL server or you…

4 years ago

Free website hosting support in this COVID pandemic

Hello everyone, The COVID-19 should have affected almost everyone in a way or another. When…

4 years ago

Amazon workspaces to build a secure work from home cloud infrastructure

Based on the current Covid19 scenario, several companies asked employees to work from home. Google…

4 years ago