Setting PHP Environment Variables

To set custom PHP Environment Variables such as register_globals, display_errors, max_execution_time, etc you will need to do so in a .htaccess file instead of a custom php.ini. We've found that this is a much better solution as any settings in a .htaccess file will affect directories and files under that folder as well instead of needing to put a custom php.ini in each and every folder.

You'll need to make changes to the variables using the "php_value" and "php_flag" directives and here are a few examples of what you will place into your .htaccess file:

php_flag display_errors off
php_flag log_errors off
php_value max_execution_time 3000
php_value memory_limit 128M
php_value upload_max_filesize 256M
php_value post_max_size 256M

Essentially anything that you can turn ON/OFF you'll want to use php_flag and anything where you will set a specific value you'll want to use php_value. If you have any questions or issues with this by all means feel free to open a support ticket and we'll be more than happy to help.

If you can not see the .htaccess file in the cPanel file manger ensure show hidden files is enabled by clicking the gear (settings) in the upper right and checking the box. If this still does not show the file, you will need to create it.

Show Hidden Files

  • memory_limit, memorylimit, memory limit, upload_max_filesize, upload_filesize, upload size
  • 164 Users Found This Useful
Was this answer helpful?

Related Articles

How do I access my cPanel?

Accessing your cPanel directly You can get to your control panel by appending "/cpanel" on to...

Can you enable "local-infile" for MySQL please?

Unfortunately this is an option that we will not enable in any of our shared environments such as...

ClipShare/phpMotion - Thumbnails generated but video not visible?

Q. I have configured the correct paths to ffmpeg and mencoder in my video sharing scripts, but it...

How do I download my copy of WHMCS?

To download your copy of WHMCS: Log into our support system at...

What are private nameservers and how do I set them up?

Private nameservers are just custom DNS and HOST records that point to our DNS Cluster IPs. ...