Bluehost India Web Hosting Help
How To Add Handlers To Change PHP Version - PHP Version Setup
This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files by directly editing your .htaccess file. If you do not wish to edit the .htaccess file you can use the cPanel to change your php version as explained in PHP Config.
Adding the Handler to the.htaccess File
The PHP handler is written into the .htaccess file. The .htaccess file is a hidden file that is read by the web server. The web server follows any instructions contained within the file. There are many ways to access this file. For the purposes of this article, we will explain accessing it through the File Manager on the cPanel of your hosting account.
- Open the File Manager located on the cpanel.
- On the directory selection popup, choose Web Root and select Show Hidden Files.
- Click Go
- In the table of files, you should see a file named .htaccess. Right click on the .htaccess file and select code edit.
- You may get a popup asking about encoding. If so, click the edit button.
At the top of the file, insert the PHP handler for the version you would like to use. If there is a handler in the file already, it should be removed or replaced with your new handler.
Note: See the Available PHP Handlers section for handlers on each of the php versions available. You can copy and paste these directly into the file.
- Click Save
Once you have saved the file, you can close it. Your account will then use the PHP version you selected.
Available PHP Handlers
The following handlers can be copied and pasted directly into your .htaccess file:
# Use PHP7 as default AddHandler application/x-httpd-php70 .php
PHP 7.0 Single php.ini
# Use PHP7 Single php.ini as default AddHandler application/x-httpd-php70s .php
PHP 7.0 FastCGI
# Use PHP70CGI as default AddHandler fcgid70-script .php
Recommended Help Content
What are Apache Handlers? How do I setup customized Apache Handlers?
How To Change Your PHP Version - PHP Config Guide
How to change your PHP version in your hosting account
This article will explain how to use Easy Apache to recompile Apache. This is useful if you want to change the version of PHP or change other PHP and Apache settings.
Related Help Content
Change Your PHP Version - Dedicated and VPS Hosting
Changing PHP versions, load custom Apache mods, and other Apache/PHP customizations
Intro to FTP
There are many ways that you can transfer files and folder to and from your hosting account. We highly recommend using an FTP (File Transfer Protocol) program to quickly upload and download files. We
Redirects that do not work due to PHP variables
The redirection of www.yourdomain.com/default.html or index.html to http://www.yourdomain.com/index.php?act=whatever redirects it to http://www.yourdomain.com/index.php%3fact=whatever In other words,
500 Internal Server Error when trying to install something with MOJO Marketplace
500 Internal Server Error when installing via the MOJO Marketplace installer.
Executing PHP code within an HTML document
Executing php code within a HTML document
How To Edit An .htaccess File - Edit htaccess file in cPanel's File Manager
Explains how to edit the .htaccess
Manually editing your error pages
How to customize your html or php error pages.
What to do if your Site Does Not Work with Newer Versions of PHP
Many popular website platforms use PHP for rendering their content. It’s common for these sites to have automatic update tools to ensure that they work with the latest version of PHP, however sometimes a theme or plugin for these services may prevent them from updating or may not work with a newer