SMTP & File Size

Hi guys,

Just installed Elgg, absolutely loving it, was just what I was looking for but I just have a couple of questions.

Firstly, I have a separate web and mail server. Can anyone tell me how to adjust the SMTP settings so I can use an external server, as I could not find this in the settings, nor anything about it when I did a search.

The second thing I'd like to know is how do I increase the upload size in the files part of the site?
My web server is set to 10MB, PHP it set to 10MB but the site still refuses to allow anything over 2MB, which is pretty much anything these days.

I thank you all in advance for your help and look forward to resolving my issues quickly.

  • There's a file named .htaccess in Elgg's install directory (the dot means the file is a hidden file so you might miss it on first glace). Within .htaccess you can adjust php variable values. For example, there's the line

    php_value upload_max_filesize 5242880

    defining the upload limit. By default it's 5MB though, so I wonder why the limit is only 2MB on your server. This might indicate that your server is configured to ignore php variable values set via .htaccess files. In this case you would only be able to change the upload filesize with the server-wide php.ini configuration or maybe some other way of configuration offered by your server (you would have to ask the hoster's support then).

    Some plugins (e.g. Tiypics or iZAP Videos) offer plugin specific upload limits for the uploaded files they deal with. In this case you would have to adjust the limit on the corresponding plugin setting pages.

    For configuration of SMTP server details you would have to look into the file settings.php in the elgg-config folder of your installation. There are two config variables

    $CONFIG->emailer_transport

    $CONFIG->emailer_smtp_settings

    By detault they are both commented out. Then Elgg uses the email MTA installed on your server. If you want to use another mail server (accessible via SMTP) you have to set $CONFIG->emailer_transport to 'SMTP' and configure the connection details of the SMTP server in the array of $CONFIG->emailer_smtp_settings. Of course, you would also have to remove the comment characters at the beginning of the corresponding lines within settings.php for the changes to take effect.

  • Thank you for your speedy reply.

    I will look in to the SMTP settings shortly.

    As for the file size, I'm using nginx so the .htaccess file is null and void.
    Nginx is set to allow 10MB uploads, PHP is set to allow 80MB, it seems to be the page itself (and the code behind it) limiting the size.

    When I click on "FIles" and then "Upload a file", just under where I choose the file I see:

    So I'm a trifle stumped on this one. I may have to ask my developer mate to delve in to the code for me.

  • nginx.conf

    http {
       client_max_body_size 10m;
    }

     

    /etc/php/7.4/cli/php.ini

    /etc/php/7.4/fpm/php.ini

    upload_max_filesize = 10M
    

     

    service nginx reload

    service php7.4-fpm reload

     

    SMTP

    Here's you'll find a sample config for SMTP