Since announcing free InterWorx with all our VPS hosting packages and Cloud Dedicated servers, we’ve had hundreds of happy customers switch from cPanel where they don’t have to worry about the new “per account” license structure.
While InterWorx comes native with a PHP selector, allowing users to select specific PHP versions for their domains/sub-domains, often we’ll get support requests on how to change values of a php setting so they can customize their website with a specific WordPress theme or plugin (i.e. max input variables, upload limit, memory limit, etc.):
View Default PHP Values
Prior to customizing PHP values, it’s always a good idea to view the server-default values to see what needs to be modified.
This can easily be done by uploading a PHP info file to the root directory of your domain or sub-domain.
Simply create a file called info.php inside the public html folder of the domain/sub-domain (i.e. /example.com/html/) with the following line of code:
<?php // Show all information, defaults to INFO_ALL phpinfo(); ?>
Next, type the URL of that file in your browser to view the defaults (i.e. https://example.com/info.php). It should look something like this:
You can use the find function in your web browser to locate the value you’re wanting to check/modify. For example, max_input_vars:
You’ll notice the two columns. The first column is the local value – meaning the specific value for the unique domain and the second column is the master value – meaning the specific value for the server itself.
To customize the value for a specific domain/sub-domain, for things like a WordPress plugin or theme, it’s the local value you’re going to update (the first column).
Create A Custom .user.ini File
In order to customize the local PHP values, you’ll need to create a custom .user.ini file with the specifics inside the document root for the domain or sub-domain (i.e. /example.com/html).
This can be done inside your favorite FTP or SSH client or even easily inside the SiteWorx File Manager, using your web browser.
The easiest way is to simply login to the SiteWorx account for the domain or sub-domain and navigate to File Manager on the left menu:
By default the File Manager doesn’t show “hidden files” which include any file or directory that starts with a period (i.e. .user.ini). Therefore we need to modify that setting so you’ll be able to double check one doesn’t already exist and can also easily modify the one you create.
To do this, you’ll want to hover Settings at the top and click on Preferences:
Beside Hidden Files click the drop-down menu and change it to Show and click on Save Changes:
When you click Save Changes, it’ll take you back to your root directory. From here, you should click on the domain or subdomain that you’re wanting to modify. Additionally, you’ll notice a public_html folder, which is a symbolic link for the master domain of the SiteWorx account.
For my example, I’m going to modify the PHP values for the defaultpanel.com domain:
You’ll then be inside the root directory for the domain, where you can see a backup folder, as well as a directory called html, meaning where all of your public-facing files are stored. Click on the html folder:
If you created an info.php file as mentioned above, you’ll also see it inside this folder. This will be useful so you can confirm your changes take effect.
Next, click on New File and enter .user.ini for the File Name:
In the text area below, enter the values you wish to customize. Some of the most common are:
upload_max_filesize = xxM; post_max_size = xxM; memory_limit = xxM; max_input_vars = xx; max_execution_time = xx;
Replace ‘xx’ with the values you’re needing. Most WordPress plugins or themes will note these in their requirements or you may have experienced an error letting you know these values need increased.
For example, I may wish to change my max upload and post size to 64MB, memory limit to 256MB, max input variables to 5000, and max execution time to 300:
upload_max_filesize = 64M; post_max_size = 64M; memory_limit = 256M; max_input_vars = 5000; max_execution_time = 300;
This would make my custom .user.ini file look like this:
Click Save and then verify by visiting that info.php file in your web browser. You should notice the values on the first column should match your custom values:
Congratulations! You have now modified your PHP values for your website! If you need to add more in the future, you can simply go back and edit that file.
For security, you’ll also want to delete that info.php file.
If you have any questions, feel free to reach out to our team of SuperHeros 24x7x365 via phone, live chat, or helpdesk!
Ryan Gray is the founder and CEO of NameHero, one of the fastest growing independent web hosts in the United States. Ryan has been working online since 1998 and has over two-decades experience in Internet Entrepreneurship.