How do I setup a custom php.ini file?

If you need some custom PHP settings for any of your directories you will need to use a custom php.ini file. Please note that the custom php.ini file you create is only valid for the directory you upload it in. The php.ini file is a normal text file created with your text editor. In that file you must put only the changes you need done. For example, if you want to enable register_globals for one directory you must create a php.ini file and put the following line in it.
register_globals = On

If you want to have the changes for all your subdirectories under public_html you should upload the php.ini in your public_html folder and add the following line to .htaccess:

SuPHP_ConfigPath /home/username/public_html/php.ini

Replace username in the path above with the cPanel username of the account you are setting up the php.ini for. Once you do the changes you can verify if it works by uploading a php script info.php with the following content in it:

<? phpinfo(); ?>

  1. Go to cPanel > the Files section > the File Manager
  2. Open public_html.
  3. In order to create a php.ini, you need to click on "File" and follow the steps below:
  4. Now, when the file is created, you need to edit it.Right-click on the php.ini file > Edit:
  5. For example you can increase the memory limit of your account.Add the lines provided below and click on "Save Changes"

 

Was this answer helpful?

 Print this Article

Also Read

Why can't I send e-mails?

If you can't send e-mail messages from our server do the following: Make sure you have SMTP...

Can I upgrade at anytime?

You can upgrade or downgrade your account at anytime. You just need to contact us about it.

What is the path?

FFmpeg -> /usr/local/bin/ Mplayer -> /usr/local/bin/ Flvtool2 -> /usr/bin/ Lame ->...

How to get support?

We provide 24/7 live chat and helpdesk support. When you contact us via live chat it is...

Changes to our Privacy Policy

If we decide to change our privacy policy, we will post those changes on this page.

Powered by WHMCompleteSolution