Reviewing and updating PHP settings

PHP settings are reviewed and updated by uploading the two corresponding files to a hosted site.  To view the current PHP settings, a phpinfo script.  To make changes to those settings, a user.ini / .user.ini settings file.
 
phpinfo
 
phpinfo is used to display the current PHP configuration for the site / server.  Specific parameters can be passed to customize the output or to display all information the following syntax can be used:
 
<?php
phpinfo();
?>
The syntax would be added to a PHP file, uploaded to the site and viewed in a browser.  An example script can also be found in the .zip in the sample section below.
 
 
user.ini / .user.ini
 
A site's PHP settings can be adjusted by creating a user.ini or .user.ini file, adding the appropriate syntax, then uploading that file to the document root of the site via FTP.  The file name depends on the version of PHP being used, which can be reviewed at Winhost Control Panel > Sites > the applicable domain name > PHP Version.
 
 
 
If the PHP version is 5.3 or 5.6 the file name is:  user.ini
For any other PHP version the file name is:  .user.ini
 
 
Sample
 
An example of a common update is the post_max_size and upload_max_filesize settings, often changed to allow plugin and theme uploads through WordPress.
 
 
 
For PHP 7.2, the settings default to 8 MB and 2 MB, respectively, which can lead to some upload errors within WordPress.  To increase those settings, for example to 60 MB, create a new text document with the following syntax:
 
post_max_size = 60M
upload_max_filesize = 60M
For PHP 7.2, the file would be saved as .user.ini, then uploaded to the document root of the site.  Once uploaded, to see the setting updates reflected on the site, first recycle the application pool at Winhost Control Panel > Sites > the applicable domain name > Recycle App Pool > Recycle App Pool.
 
 
 
Once recycled, the new Local Value should be reflected when reviewing a phpinfo script.
 
For an example phpinfo script and both a user.ini and .user.ini file, download PHPsettings.zip