Web Hosting Knowledge Base / Hosting and Websites

How to modify PHP variables like memory_limit?

At 2MHost, you can set number of PHP variables from your cpanel instead of using php_value in .htaccess or using custom php.ini file:

  • allow_url_fopen
  • max_execution_time
  • max_input_time
  • max_input_vars
  • memory_limit
  • open_basedir
  • post_max_size
  • short_open_tag
  • upload_max_filesize

You can't modify this variables of the native PHP version (the PHP that runs all websites in the server) so you need first to choose a non-native PHP version from your cpanel:

  1. login to your cPanel
  2. Scroll down to Software tab, and click on 'Select PHP version'

  3. Select the PHP version you want from the list (Always choose the most modern version when possible)

  4. And do not forget to set the select version as current

  5. Now non native PHP is active
  6. Switch to 'Options' menu

  7. Set the required PHP variables and you are done .

Remember that you have to adjust post_max_size to be equal or bigger than upload_max_filesize, both variables are responsible of files uploading

Last update: Aug 15, 2020 19:58