Nerdier

Adjective: Comparative form of nerdy: more nerdy.

PHP Handler in cPanel

This is how you add a PHP handler in cPanel, it should work for any version, but I’m using 5.2 as an example as that’s what I used.


Create a php 52 file

nano /usr/local/cpanel/cgi-sys/php52

Add the following

#!/bin/sh
exec /usr/bin/php52

Set the permissions

chmod +x /usr/local/cpanel/cgi-sys/php52

Create an includes file

nano /usr/local/apache/conf/includes/pre_virtualhost_global.conf

Add the handler action

Action application/x-httpd-php52 /cgi-sys/php52

Run the config updater

/usr/local/cpanel/bin/apache_conf_distiller --update

Restart apache

service httpd restart

Add the following to the .htaccess

AddHandler application/x-httpd-php52 .php

Leave a Reply

Your email address will not be published. Required fields are marked *