The php.ini file and changing PHP Settings


The php.ini file is a special file for PHP and various flavors such as suPHP (pronounced sue-p-h-p).

The php.ini file is where you declare changes to your PHP settings. You can use the default settings for the server, change specific settings by editing the existing php.ini, or create a new text file and name it php.ini.

Default Settings


The server is already configured with standard settings for PHP that have been selected by our administrators to be the most optimal setting for a majority of our customers.  Unless you specifically need to change one or more of the settings, there is no need to create or modify a php.ini file.  If the php.ini file does not exist in your account, then your site will use the default PHP settings defined on the server.

Create a php.ini File


This file should be created in your cPanel Home directory (/home/username/). For VPS Plesk users the file should already exist in the following directory:

◼/var/www/vhost/$DOMAIN/etc/php.ini

Be sure to replace "username" with your actual cPanel user name, and "$DOMAIN" with your actual domain.

How to create a new php.ini file in cPanel:

1. Login to cPanel.
2. In the Files section, click on the File Manager icon.
3. Select Home Directory and click Go.
4. Click the New File button at the top of the page.
5. In the field called New File Name, enter php.ini and click Create New File.
6. Click the file named php.ini.
7. Select the Edit button at the top of the page and click the Edit button in the pop-up box.

You can now input the contents of your php.ini file and click save. For a complete set of default php.ini files for PHP versions 5.2 through 5.5 click the link below.

▷ Default php.ini Files


Select a button below for the PHP version used on your account. If you are unsure of what PHP version your site is running, you can use the phpinfo function to locate the correct version.

php.ini 5.2

php.ini 5.3

php.ini 5.4

php.ini 5.5

php.ini 5.6

If you need assistance creating a php.ini file for your account, please contact us via phone or live chat.

Making Changes Global


Now that you have an accessible php.ini file you can use the code provided within this section to make the file global for your entire account. This is done by using the SuPHP handler, which designates what php.ini file to execute.

Note: If this step is not completed, the changes made within the custom php.ini file will not take effect and the file will not be referenced when your site is accessed.
The following code should be placed at the top of your .htaccess file inside the public_html folder.

Be sure to replace "username" with your actual cPanel user name.

<IfModule mod_suphp.c>

suPHP_ConfigPath /home/username

<Files php.ini>

order allow,deny

deny from all

</Files>

</IfModule>

Moving to suPHP


Some common changes must be made when moving from non-secure php environment to suPHP. For example, if your site had these settings in the .htaccess file:

php_flag upload_max_filesize 10M

php_value post_max_size 10M

php_value max_execution_time 30

SuExec users must put them in a php.ini file instead. Here is the proper syntax:

  upload_max_filesize = 10M

post_max_size = 10M

max_execution_time = 30

Note: Our support cannot know why you want or need to change these settings. You are changing this at the advice of your web designer or the developer of your script. We can only show you where to make the change.

0 comments:

Post a Comment

Facebook

Popular Posts

Blog Archive

Total Pageviews