wiki:faq/server/change-php-ini-settings

Version 12 (modified by Jamie McClelland, 13 years ago) ( diff )

--

How do I increase my PHP file upload limit or change my php.ini settings?

When accessing via the web

You have full control over your PHP installation - you can change any php.ini setting that you would like. By default, your sites will use our global php.ini file (which is located in /etc/php5/cgi/php.ini).

If you would like to override any of those settings:

Edit your custom php.ini file. It will be located in /home/members/MEMBERNAME/sites/DOMAIN/include/php5/php.ini. For example, if you want to increase the upload file limit size, you may want to add:

upload_max_filesize = 12M
post_max_size = 12M
max_execution_time = 300

Note: when increasing your upload_max_filesize, you should also:

  • increase your post_max_size (the maximum amount of the total size of posted data) and the max_execution_time (amount of time your script is allowed to execute - it might take a while to upload a large file)
  • And, if you are increasing the max file size above 8 MB, you will also need to change your fcgid settings in the control panel.

Optionally, you may also want to increase the amount of memory your php scripts can use with:

memory_limit = 64M

Another option is to turn off APC (only do this if you are experiencing segfaults in your error logs:

apc.enabled=0

Once you have created this file you may need to reload your web settings to force the change to take affect. You can do that by logging into the Members control panel, choosing Web Configuration, click edit next to your web configuration, and then submit (without making changes).

IMPORTANT: Please use caution when changing these settings. Take note of the default setting and only change minimally as needed. We are operating on shared servers - so if you change your site to use more resources, you may have an adverse impact on the other members.

When accessing via drush

If you are using drush, your custom php.ini file will not be used. To change settings, create a file called drushrc.php and place this file in your Drupal site's sites/default/ directory. You can add settings like:

<?php
ini_set('memory_limit','128M');
Note: See TracWiki for help on using the wiki.