Access php ini in cpanel

Controlling PHP settings with a custom php.ini file

This article describes how to use custom php.ini files to control PHP settings for your web site.

This article applies to non-Turbo managed hosting packages with the cPanel management interface. For Turbo hosting packages, please see this article.

Setting up a custom php.ini file

A php.ini file contains directives for controlling many PHP settings. You can set up one or multiple custom php.ini files to define how your web site functions. For example, you might have a custom file in your /home/username/public_html directory for your web site's main pages, and a separate custom file in your /home/username/public_html/images directory for your web site's image files.

To set up a custom php.ini file, follow these steps:

  1. Log in to cPanel.

    If you do not know how to log in to your cPanel account, please see this article.

  2. Using the File Manager, navigate to the directory where you want to modify the behavior of php. By default, a custom php.ini affects only the directory where it is located. 
  3. Click the File button in the File Manager toolbar to create a new file and name it php.ini.
  4. Click on the new file and then click the Edit button in the File Manager toolbar to edit the new php.ini.
  5. Add php directives to the new php.ini and then click the Save Changes button.
  6. After you create the php.ini file and set its permissions, you can verify that the configuration is active. To do this, create a phpinfo file in the directory where you created the php.ini
  7. Load the phpinfo file in your web browser, and locate one of the directives you set. Make sure the changes are shown.
  8. You can create custom php.ini files for each directory in your web site, but many people configure settings in one php.ini file and then apply it to the entire web site. To do this, add the following line to the .htaccess file in your web site's document root directory. Replace username with your A2 Hosting username:
    lsapi_phpini /home/username/public_html/php.ini

More Information

To view a complete list of php.ini directives, please visit http://www.php.net/manual/en/ini.list.php.

Access php ini in cpanel

The latest versions of cPanel make it easy to choose what PHP version your site is using. With just a few clicks, you can switch between different versions and even use different versions across sites in the same cPanel. This is especially helpful when upgrading older sites, troubleshooting, or dealing with third-party applications. Let’s take a look at how to make the most of PHP on all types of servers!

  • PHP Versions and Server Types
  • cPanel’s MultiPHP Manager
  • Change the PHP Version on Your Sites

Don’t have time to read the article on how to change PHP Version? Watch our walk-through video.

PHP Versions and Server Types

Our SysAdmins install the latest versions of PHP on our Shared, Reseller, and cPanel-based WordPress servers after testing and troubleshooting. The ‘default’ version of PHP for newly created sites is often one or two versions behind for the sake of stability— but feel free to update to the latest version as soon as it is available!

With VPS and Dedicated Servers, we trust you and your SysAdmins to manage PHP installation and updates. If you need help, though, our 24/7 Technical Support team is happy to install newer versions of PHP at your request!

If you have a VPS or Dedicated Server, newer versions of PHP may need to be installed manually.

cPanel’s MultiPHP Manager

Just a few years ago, managing different cPanel PHP versions was an all-or-nothing ordeal. Older tools would change the PHP version for every site on a cPanel at once. Configuring different individual sites required awkward workarounds using .htaccess files. The latest versions of cPanel introduced a new tool, MultiPHP Manager, which simplifies the process. Click on the MultiPHP Manager icon in the Software section of cPanel to get started!

Access php ini in cpanel

Please Note: be sure to click on MultiPHP Manager and not MultiPHP INI Editor. The INI Editor is a different piece of software that helps you fine tune your PHP settings on individual sites.

Change the PHP Version on Your Sites

Now that you know what the MultiPHP Manager is, we’ll show you how to use it to change the PHP version for your sites.

  1. Login to cPanel.
  2. Click the MultiPHP Manager link in the Software section of cPanel.
  3. Check the box for the site or sites you wish to update.
    Access php ini in cpanel
  4. Select the desired PHP Version from the drop-down menu.
    Access php ini in cpanel
  5. Click the Apply button.
    Access php ini in cpanel

That’s all it takes to change the PHP version used on any site you choose. If you are having issues with a site and want to double-check the version of PHP in use, remember that you can always set up a PHPinfo page for the site as well. Learn more about cPanel from our Managed VPS Hosting Product Guide.

Make sure your business, agency, or reseller clients are always connected and powered on with our optimized Managed VPS Hosting.

Where is PHP ini file located in cPanel?

Each file exists in the /opt/cpanel/ea-php72/root/etc/php. ini file, where 72 is the PHP version number.

How do I change PHP ini in cPanel?

How to Edit the php..
1) Log into cPanel..
2) Look for the SOFTWARE section and click on Select PHP version..
3) In the new window click on the Switch To PHP Options button..
4) Here you can locate the PHP directive you wish to amend and click the value..

How do I access my PHP ini?

ini is usually located in /etc/php/8.1/fpm/php.

Where is PHP ini in file manager?

ini file is located at /usr/local/lib/php. ini.