Where do i put php ini file?

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.

  • Overview
  • Available PHP Versions
  • How to Update PHP
  • Fix MultiPHP Error
  • php.ini
  • Limits
  • View Settings

The php.ini file is a special file for PHP. It is where you declare changes to your PHP settings. The server is already configured with standard settings for PHP, which your site will use by default. Unless you need to change one or more settings, there is no need to create or modify a php.ini file. If you would like to make any changes to settings, please do so through the MultiPHP INI Editor.

  • How To Modify PHP Settings
  • How To Create a New php.ini File

How To Modify PHP Settings via the MultiPHP INI Editor

There may be times where you need to change some of the default PHP settings, and below we've outlined those steps. However, keep in mind that there are PHP Settings That Cannot Be Changed on our Shared, Cloud, & Reseller hosting.

To modify the PHP settings:

  1. Log in to cPanel.
  2. In the Software section, click on the MultiPHP INI Editor icon.

  3. On the MultiPHP INI Editor page, select Home Directory or the specific domain you wish to update from the Configure PHP INI basic settings dropdown.

  4. Select the new setting for each PHP directive you would like to change.

  5. Click Apply at the bottom to save your changes.

How to Create a New php.ini File

Important Note: HostGator won't know why you want or need to change these settings. You would change this at the advice of your web designer or the developer of your script. HostGator can only show you where to make the change.

  • For Plesk users, the file should already exist in the directory  /var/www/vhost/$DOMAIN/etc/php.ini.
  • For the cPanel, this file should be created in your Home directory [/home/username/].

The username is your actual cPanel username, and $DOMAIN is your actual domain.

To create a new php.ini file in your cPanel:

  1. In the Files section of your cPanel, click on the File Manager icon.

  2. Select the root directory for your site. The default for the primary is public_html.
  3. Click the + File button at the top left of the page.

  4. In the pop-up box, enter php.ini in the New File Name field. Make sure the root directory is in the bottom box.

  5. Click Create New File.
  6. Locate and right-click the new php.ini file and select Edit, then click the Edit button again.
  7. You can now input the contents of your php.ini file. Click Save to save your changes.

Where do I upload PHP ini file?

PHP File Upload.
Configure The "php.ini" File. First, ensure that PHP is configured to allow file uploads. ... .
Check if File Already Exists. Now we can add some restrictions. ... .
Limit File Size. The file input field in our HTML form above is named "fileToUpload". ... .
Limit File Type. ... .
Complete Upload File PHP Script..

How do I install a PHP ini file?

How to Manually Create a PHP..
Log into your cPanel account..
Open your File Manager..
Navigate to your public_html directory..
Create a new file..
Name it php.ini..
Edit the php.ini file you just created..
Copy and Paste the default php. ini code from the copy of the default version below..
Click Save Changes..

Do I need a PHP ini file?

ini file is a special file for PHP. It is where you declare changes to your PHP settings. The server is already configured with standard settings for PHP, which your site will use by default. Unless you need to change one or more settings, there is no need to create or modify a php.

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]. Under Linux, most distributions put lampp under /opt/lampp , so the file can be found under /opt/lampp/etc/php.

Bài mới nhất

Chủ Đề