Php ini cpanel location

Nuestra base de conocimientos sólo está disponible actualmente en inglés. Estamos en el proceso de traducir estas páginas y las publicaremos cuando estén disponibles.

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.

Grow Your Web Business

Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.

No charge. Unsubscribe anytime.

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

In this section, we will learn the use of CPanel to create a custom php.ini file. The php.ini file is the most important configure file. In this file, we will declare our PHP settings changes. When we use php to run any application, it will be useful to solve the config while running. We will mostly use it at the time of file timeouts, resource limits, and controlling upload size. If we want to control many php settings, the php.ini file will be very useful for us because it provides directives. When we want to define the functions of the website, we can set up one or more than one custom php.ini file. The main page of our website might contain a custom file in our directory as /home/username/public_html. The image file of our website might contain a separate custom file in our directory as /home/username/public_html/images. The custom php.ini file will only affect the directory in which it is located by default.

We can use Godaddy cpanel and another hosting to create it. In CPanel, we can increase the memory_limit, max_file_uploads, upload_max_filesize, max_execution_time, post_max_size and may more things in php ini file.

In default php ini file, the basic configuration is provided by mostly server like hosting raja server, a2hosting server, and GoDaddy server. Sometimes, we are required to increase the memory limit of the file, maximum upload file size, etc. In case of the creation of php ini file, the different server uses different ways to create it. To explain it, we are providing two examples. In this example, we are going to see the creation of a custom php.ini file with a php ini file's change default value.

Php ini cpanel location

We are going to make the following changes in our GoDaddy project's file named as .user.ini. So we have to put the following code on our root directory only because if we don't do this, it will affect our whole project.

Path: public_html/mypro.com/index.php

Create File Path: public_html/mypro.com/.user.ini

If any case, the above solution will not work, the alternative solution of this is described as follows:

Where is the PHP ini file in cPanel?

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

Where is the PHP ini file located?

For Windows, you can find the file in the C:\xampp\php\php. ini -Folder (Windows) or in the etc -Folder (within the xampp-Folder). Under Linux, most distributions put lampp under /opt/lampp , so the file can be found under /opt/lampp/etc/php.

How do I edit an ini file in cPanel?

Modifying the PHP..
Login to the cPanel..
Find the File Manager in File section of the cPanel. ... .
Navigate to the directory where you will either save or edit the PHP. ... .
Edit the section of the PHP. ... .
Click on SAVE CHANGES in the top right hand corner in order to save your modifications or additions to the file..

How to access PHP in cPanel?

Determine a user's PHP version.
Use WHM's MultiPHP Manager interface (WHM » Home » Software » MultiPHP Manager). ... .
Use cPanel's MultiPHP Manager interface (cPanel » Home » Software » MultiPHP Manager)..
Navigate to the /home/username/public_html directory, where username represents the user's username..