How can i edit php ini?

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 //www.php.net/manual/en/ini.list.php.

This guide describes how to edit the php.ini file on shared servers [Stellar and Stellar Plus plans, as well as old Value, Professional, and Ultimate plans].

If your account is hosted on the Business server [Stellar Business or old Business SSD plans], use this guide.

However, advanced PHP settings are missing from the Select PHP Version tool and must be manually configured in the php.ini file. You can either create the file or upload the existing one to your account.

1. Log into your cPanel account, go to the Files section >> the File Manager menu.

For cPanel Basic Theme:

For cPanel Retro Theme:

2. Navigate to the root directory of the domain, click on New File, and create a file named php.ini:

3. Find the newly created file in the list, right-click, and choose Edit:

4. Add the required PHP settings and click on Save Changes in the top right corner:

1. Log into your cPanel account, go to the Files section >> the File Manager menu.

For cPanel Basic Theme:

For cPanel Retro Theme:

2. Navigate to the root directory of the domain name in question, upload the php.ini file. Feel free to download php.ini below in the Attachments section at the end of the guide.

3. Once done, use the Extract option:

4. After that, right-click on php.ini to use the Edit option:

5. Here, you can use the search option and find the needed limit or value. In this example, it is upload_max_filesize.

6. Once all the required changes are made, click Save.

That's it!

Need any help? Contact our Helpdesk

How do I edit a PHP ini file?

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 do I open a PHP ini file?

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].

How do I configure PHP ini?

To configure a PHP setting.
In Windows Explorer, open your PHP installation folder, for example C:\PHP ..
In a text editor, open the php. ini file..
Search the file for the setting you want to change. ... .
Save and close the php. ... .
Recycle the IIS Application Pools for PHP to pick up the configuration changes..

Where is PHP ini in file manager?

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

Bài mới nhất

Chủ Đề