Aegir / Drupal

Increasing PHP Max Upload size on Aegir sites.

SInce Aegir takes care of a lot of maintenance tasks, you can’t directly insert this in your vhost configuration. Adding code to settings.pp has no effect as well. So you have to work with aegir’s drush files.

As described in Injecting into site vhosts, we can inject values into vhosts using a Drush hook. For example, to raise the file upload size limit on http://www.mysite.com, I added the following code in /var/aegir/.drush/mysite.drush.inc:


<!--?php
function mysite_provision_apache_vhost_config($uri, $data) {
if ($uri == "www.mysite.com") {
drush_log("Overriding PHP file size values. See .drush/mysite.drush.inc");
return array("php_value upload_max_filesize 100M", "php_value post_max_size 200M");
}
}
?>

Note that you can name the file (mysite.drush.inc, anyname.drush.inc) and function (mysite_provision_apache_vhost_config, anyname_provision_apache_vhost_config) any name you want as long as it’s in the right directory.

Then verify your site in Aegir. This results in the insertion of the following lines into /var/aegir/config/server_master/apache/vhost.d/www.mysite.com:

php_value upload_max_filesize 100M
php_value post_max_size 200M

Also, in the verify task log I get the following informative message:

Overriding PHP file size values. See .drush/.drush.inc

Reference: http://community.aegirproject.org/content/overriding-site-specific-php-values

Advertisements

2 thoughts on “Increasing PHP Max Upload size on Aegir sites.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s