Paper Lantern for cPanel accounts is being retired this year. Find out more »
cPanel & WHM Version 102 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Put PHP version choices in server configuration

Yehuda Katz shared this idea 4 years ago
Open Discussion

This was originally submitted on March 26, 2018 and was lost in the March 28th server failure.

As a web developer, I would like the PHP version choice to be stored somewhere other than the `.htaccess` file. Having it in the `.htaccess` makes a git working tree dirty or can break things when a site is moved between a development server and a live server.

I see two options for this:

  1. Store the PHP version choice somewhere besides the `.htaccess`. This could be in the server config (although that would require a restart of `httpd` for any change.
  2. Wrap the config in the `/htaccess` in a cPanel-specific `<if>` directive. For example, create a dummy Apache module and use `<IfModule cpanel_server>` or define an environment variable and use `<IfDefine cPanelMultiPHP>`

Having a dirty git repository can cause a conflict with the new version control feature.

Replies (1)


+1 for this. Can there be a configurable cpanel option (both globally and per-vhost) to change between storing the multiPHP PHP version choice in .htaccess and the Apache vhost configuration?

Leave a Comment
Attach a file