How to change PHP settings (upload size, memory limit) Print

  • 0

Some tasks need higher PHP limits than the defaults, for example uploading a large theme, importing a big database or running a heavier plugin. You can change the most common settings yourself.

Change PHP options

  1. In cPanel, open Software → Select PHP Version.
  2. Click the Options tab.
  3. Click the value next to the setting you want to change and pick a new one. It's saved automatically.

PHP options such as memory_limit, post_max_size and upload_max_filesize

The most useful settings

SettingWhat it doesSuggested value
upload_max_filesizeLargest single file you can upload through your website64M or 128M
post_max_sizeLargest total size of a form or uploadthe same as or larger than upload_max_filesize
memory_limitMemory one PHP script may use256M for WordPress sites with many plugins
max_execution_timeSeconds a script may run60 to 300 for imports
display_errorsShows errors on your web pagesOff on live sites
WordPress says "The uploaded file exceeds the upload_max_filesize directive"? Raise upload_max_filesize and post_max_size here, then reload the WordPress page.

Good to know

  • These options apply to the PHP version selected for your account. If you switch PHP versions, check them again.
  • Don't set values much higher than you need. A very high memory limit won't make your site faster.

Related: How to change your PHP version


Was this answer helpful?

« Back