Change PHP settings
PHP settings control how much memory a script gets, how large an upload can be, and how long a script may run. Change them when you see errors such as "Allowed memory size exhausted" or "The uploaded file exceeds upload_max_filesize". Each site has its own settings.
Change a site's settings
- Open Account → Hosting → your site → Performance. On the PHP version and settings card, click Choose PHP for each site.
- Find the card for your site and open PHP settings.
- Change the values you need. Each list starts with Default, which shows the value in use now.
- Click Save. Changes take effect in a few seconds.
We check that the site still loads and that PHP reports the new values. If something didn't take effect, we put the previous settings back and tell you which ones.
The settings
| Setting | What it controls | Typical value |
|---|---|---|
Memory per request (memory_limit) |
Memory one page load may use | 256M |
Largest upload (upload_max_filesize) |
Biggest single file you can upload | 64M |
Largest form post (post_max_size) |
Biggest form submission. Must be at least the largest upload | 64M |
Time limit per request (max_execution_time) |
Seconds before a script is stopped | 120 |
Time limit to receive a request (max_input_time) |
Seconds allowed to receive an upload or form | 120 |
Form fields per request (max_input_vars) |
Fields per form. Page builders and big menus need more | 3000 |
| Errors to report | Which errors PHP records: Everything, Errors and warnings, or Serious errors only | Errors and warnings |
| Show errors to visitors | Prints errors on your pages | Off on a live site |
| Write errors to the error log | Records errors in the error log | On |
| Time zone | The time zone PHP uses for dates | Your own, such as America/Halifax |
Your plan's memory limit still caps what a request can actually use. See Resource limits explained.
allow_url_fopen (opening remote files) is on for the whole server. Ask us if a plugin needs it changed.
Where the settings are stored
We save them in a marked block at the top of the site folder's .htaccess file, above your own rules, which we leave untouched. We keep the last five versions of the file in ~/.barbrick/htaccess. Don't edit the marked block by hand. Change it from the PHP for each site page instead.
If a setting shows Set by other lines in this site's .htaccess, so it's managed there, your .htaccess already sets it further down. Remove that line, then set the value from the page. A hint saying Also set in .user.ini means a .user.ini file also sets it. Remove it there to avoid confusion about which value applies.
Check
<?php
echo ini_get('memory_limit');
Or use phpinfo(). See Change PHP version and extensions.
WordPress
WordPress has its own memory constants. See Raise the WordPress memory limit.
If something goes wrong
- We put the previous settings back: the message names what didn't take effect. Check for a conflicting line in
.htaccessor.user.ini, or ask us. - 500 error after editing
.htaccessyourself: undo your last edit. Copies from your last saves on the PHP for each site page are in~/.barbrick/htaccess. - Limit seems capped: your plan caps memory. See Resource limits explained.
Still stuck? Ask us and we'll walk you through it.
