Setting PHP values using a .htaccess file

Setting PHP values using a .htaccess file

If your server runs in CGI mode like dso then you can’t use a php.ini file to change the values PHP can use. All of our reseller and hosting servers run SuPHP so you can use a php.ini file to modify PHP’s values. Here’s how to do this using a .htaccess file. As default, we now use CGI instead of SuPHP

The .htaccess file is usually found in each directory. You can’t see this file using PHP so you will need to use the in build file manager to navigate to your home directory. There is an option to “show hidden files” this should be ticked. To modify the values for the whole user account modify the .htaccess file that’s located in the public_html folder. To modify the values for a single folder navigate to that folder and find the .htaccess file inside it. You can then add your values for PHP to this file and save the document.

Free cPanel VPS License

You must include the path to PHP in the top of the document as shown below.

php_value  include_path         ".:/usr/local/lib/php" 
php_flag   display_errors       Off
php_value  upload_max_filesize  2M

How was this article?

Setting PHP values using a .htaccess file
How was this post?

Dedicated Servers VPS Servers

Select Language
We are currently updating our website. Please accept our apologies for any disruption you may see.
+