How to change PHP values Print

  • PHP
  • 0

You can change the default values in PHP through the .htaccess file that you add or edit, if it's already there, in your site's home folder. You can access or create the .htaccess file through the File Manager in your site's control panel (Siteworx) or using FTP.

You will find the steps to change the values in PHP in your hosting account below. Following is a brief summary of the steps.

  1. First we will check for the .htaccess file. If one hasn't been created yet, we will create one.
  2. Next, we will add instructions in the .htaccess file to look in a second file named ".user.ini" and protect it from view. This file is where we will put the new values for PHP.
  3. Next, we will check for the .user.ini file. If one hasn't been created yet, we will create it and add our new PHP values to it.

Access .htaccess through File Manager

File Manager access through Siteworx

If you choose to use Siteworx to add or edit the .htaccess file, first set up File Manager to View hidden files if you haven't already done so. Files starting with a period, like ".htaccess", are hidden by default. To check and change it, after opening File Manager, select Preferences from the Settings menu at the top of the page.

File Manager Preferences under Settings menu

Next, check the Hidden Files option and then, if needed, change it to Show hidden files and then click on Save Changes

File Manager Preference to View Hidden Files

Now that you can view hidden files, browse to the location of your home page folder by clicking on "yourdomainname.ext" and then on the folder named "html". If you already have a file named .htaccess, it will appear in alphabetical order at the top of the list of files. If you don't see it, create an new empty file by clicking on New File and then type ".htaccess" (including the period but without the quotes) into the box provided, then click Save. Now you're ready to edit the file.

 

PHP ini Changes

Now we're going to locate or create the file named ".user.ini" and instruct .htaccess to look in it for additional instructions and protect it from view.

You should see the file named ".user.ini" just below the .htaccess file in your list of files. If you don't see it, create an new empty file by clicking on New File and then type ".user.ini" (including the periods but without the quotes) into the box provided, then click Save.

Next, open the file named ".htaccess" and enter the following lines to it, and Save the file:

<Files ".user.ini">
<IfModule mod_authz_core.c>
	Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
	Order deny,allow
	Deny from all
</IfModule>
</Files>

 

Open the file named ".user.ini" and enter the new PHP values you want to use, one per line, and Save the file. An example is included for reference below, but your values might be different.

upload_max_filesize = 32M
post_max_size = 32M
max_input_vars = 1620

 

That's it! The PHP values go into effect immediately. 


Was this answer helpful?

« Back