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

Version 2 (modified by Jamie McClelland, 15 years ago) (diff)

--

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

Note: this help file does not apply if your primary host is viewsic.mayfirst.org. If your primary host is viewsic.mayfirst.org and you would like your php settings modified, please submit a ticket.

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/apache2/php.ini).

If you would like to override any of those settings:

  • Create a new directory. You can use any name or location of the directory, however, we recommend using: include/php5. You should already have an include directory - at the same level as your web directory.
  • Create a file in that directory called php.ini (it must be called php.ini). In that file, only include the directives that you want to change. 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).

  • You may also want to increase the amount of memory your php scripts can use with:
memory_limit = 64M
  • Another option is to turn of APC (only do this if you are experiencing segfaults in your error logs:
    apc.enabled=0
    
  • Once you have created this file, login to the Members control panel and add this line to your Web configuration setting:
suPHP_ConfigPath /home/members/<member-name>/sites/<domain-name>/include/php5

Note: Do not include the name of the php.ini file, just the path to the directory where it is located.

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.