1. Home
  2. Docs
  3. User Guide
  4. PHP
  5. Edit php.ini

Edit php.ini

Edit php.ini changes PHP settings for one of your domains — for example the maximum upload size, memory limit or time zone — without affecting your other sites.

Where to find it: CWP Settings → Edit php.ini.

Php.ini Editor

Choose the domain

Select the domain at the top. Path shows the file where the settings are stored, usually /home/youraccount/public_html/.user.ini for the main domain or the .user.ini in the folder of an addon domain or subdomain.

Basic Editor

The Basic Editor tab lists the current settings.

  1. Change a value in the Value column.
  2. Click Update changes to save all changes.

Each row has two buttons: the blue tick enables or disables a setting (a disabled setting is kept in the file but ignored), and the red bin deletes it.

Add a setting

Under Add new record, choose a setting from the list, enter its value and add it. Choose Add custom to type the name of any PHP setting that is not in the list.

Advanced Editor

The Advanced Editor tab shows the whole file as text, for experienced users. Use the format setting = value, one per line, and save.

Commonly changed settings

SettingWhat it doesExample
upload_max_filesizeLargest file that can be uploaded through a website64M
post_max_sizeLargest form submission; must be at least upload_max_filesize64M
memory_limitMemory one PHP script may use256M
max_execution_timeSeconds a script may run before it is stopped120
max_input_varsNumber of form fields accepted (raise for big menus or WooCommerce)3000
date.timezoneTime zone used by PHPEurope/London
display_errorsShow PHP errors in the page. Keep Off on live sites; use the Log Viewer instead.Off
error_reportingWhich errors are reportedE_ALL & ~E_NOTICE & ~E_DEPRECATED

Note: Your hosting provider may limit how high some values can be set. Settings such as register_globals and magic_quotes_* no longer exist in current PHP versions and are ignored. Changes can take up to a few minutes to apply, because PHP re-reads .user.ini periodically.

Common problems

ProblemSolution
The change has no effectWait a few minutes, check you edited the correct domain, and confirm with a phpinfo() page. A value set in .htaccess or by the application itself can override it.
Site breaks after a changeA value has a wrong format (for example 64 MB instead of 64M). Fix or delete the setting.
Invalid input valueThe value is not accepted for that setting. Check the format in the examples above.
An error occurred while trying to write to your php.ini fileThe File System Lock is on, or the file is owned by another user. Unlock it or run Fix Account Issues.

Related

Was this article helpful to you? No Yes