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 the following directives. These values can be changed from the php.ini file. 
memory_limit
post_max_size
upload_max_filesize
max_execution_time

Windows VPS Hosting

With the default Windows VPS configuration, you may find the 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 to the php.ini file located at the 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 a specific website, you can simply copy the default php.ini file and paste it into the wwwroot folder of the website. Similarly, if any subfolder of your website requires custom PHP settings, you can copy this file to the subfolder and make desired PHP settings.
 
To verify that the php.ini file is being loaded from the website’s wwwroot folder (the path where you have uploaded the 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 the wwwroot folder of your website, paste the 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. The phpinfo page should look like the following.

phpinfo page

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

Configuration Path

Windows Shared Hosting

For customers using Windows Shared Hosting, you do not have direct access to the php.ini file.

Hence, Windows Shared Hosting customers can submit a ticket from the client area to set a custom php.ini file on 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 the php.ini file.

Notes:

php.ini file path can be different if you have made changes in the VPS's default PHP configuration or you have installed an additional PHP version in the VPS.

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.

Was this answer helpful? 0 Users Found This Useful (0 Votes)