How to Set Custom php.ini file on my Web Hosting Service?

Sometimes you are required to set custom php environmental variables or update php settings for some websites. For example, while using the most popular script of WordPress, you may need to set following directives. These values can be changed from php.ini file. 

memory_limit
post_max_size
upload_max_filesize
max_execution_time

Windows VPS Hosting


With default Windows VPS configuration, you may find php.ini file at the following path. You just need to edit this file using any editor such as Notepad++, set values for php directives, disable/enable variables and save the file. Please note that changes you made at php.ini file located at above path will be reflected globally. It will affect all php websites hosted on your server.

C:\Program Files (x86)\PHP\v5.X
When you are required to make changes in some specific website, you can simply copy default php.ini file and copy it to wwwroot folder of the website. Similarly, if any subfolder of your website requires custom php settings, you can copy this file to subfolder and make desired php settings.





To verify that php.ini file is being loaded from website’s wwwroot folder (path where you have uploaded php.ini file with custom changes), you will need to create a phpinfo page. A phpinfo page shows all of your php environment settings. A phpinfo page is simply a php page with the following code.

 <?php phpinfo(); ?>

To create a phpinfo page, create a plain text file in wwwroot folder of your website, paste above lines and save the file. The file name can be named anything, phpinfo.php is just a symbolic common name for this file. If you created the file in your wwwroot folder, then you should browse phpinfo.php like, http://<yourdomainname>.com/phpinfo.php. phpinfo page should look like following.

phpinfo page

You can verify that php.ini is loaded from the correct path by searching “Loaded Configuration File” via browser's search feature ( Ctrl + f ). Similarly, you can also search for custom settings you have done to php.ini file and verify that those settings have been reflected.

Configuration Path

Windows Shared Hosting


Windows Shared Hosting customers can submit the ticket from client area to set custom php.ini file in their website.

Linux VPS & Linux Shared Hosting


Linux VPS & Linux Shared Hosting customers can refer to this article to make custom php variable settings via php.ini file.

Notes

  1. php.ini file path can be different, if you have made changes in VPS' default php configuration or you have installed additional php version in VPS.
  2. phpinfo page has many php settings that you don't want to show to the world. You should delete this file when this file is no longer in use.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

I am unable to do RDP in my Windows VPS. What could be the possible reasons?

Please check the following: Ensure that you are using correct IP to do RDP. Ensure that your...

How to change the default RDP (Remote Desktop) listening port on your Windows VPS?

By default Windows machines are remotely accessible via Remote Desktop on TCP port 3389. In...

How to Add IIS Role in Windows 2008 Server?

Internet Information Services (IIS) is a web server developed by the Microsoft for hosting web...

How to Disable LAN Sync Feature In Dropbox Client To Stop Unwanted UDP Traffic?

Dropbox is an easy to use Cloud storage and File file-syncing Service. It allows you to share and...

What are the benefits of running SENuke X on Windows VPS?

Benefits of running SENuke X on Windows VPS: It runs 24*7, SEnuke X includes scheduling...