Elgg Installation fine... but not fuctioning: improper .htaccess? PHP setup?

Hi All,

I was really pleased with myself for getting Elgg installed as a subdomain (installation "wizard" ran to completion after a few minor changes)... but disappointment followed when I tried to invite a friend... saw a green box saying "Message to Friend sent" (or similar(!)) but no invite received in friend's email (not even in spam box).

So... some research and I'm wondering if:

.htaccess not right? It's just as I obtained it on download...

Not reaching(?) PHP files on the server? I found this in an error log:

PHP WARNING: 2019-03-10 20:39:30 (GMT): "Invalid argument supplied for foreach()" in file /home3/mydomain/public_html/friendsnow/elgg-2.3.10/vendor/elgg/elgg/engine/classes/Elgg/SystemMessagesService.php (line 130)
[11-Mar-2019 09:01:36 Europe/London] ERROR: The view resources/index is missing.

... and the final line above being then repeated about a zillion times!

I checked the elgg-config/settings.php file and because (so I believe) it only comes into existence with this name if all is fine with it's configuration... I hope it's OK.

Hoping for some advice to help me get things working... and develop my knowledge!

Thanks,

Striver

  • Read the docs

    PHP WARNING:

    Something wrong in your PHP configuration - check [Session] section in php.ini

  • Thanks for your reply, RvR, I'll look into that.
    Striver

  • Have you got it working?

    Do you really meant installation on "subdomain" or have you installed in "subdirectory"? In the latter case you would have to adjust RewriteBase in Elgg's .htaccess accordingly. And with a subdomain it might also help to set RewriteBase to "/" (i.e. enabling the corresponding line in .htaccess).

  • Hi All,

    Thanks everyone for your advice and suggestions. I have made a step forward!

    As suggested by RvR above(big thanks) I read the docs re. missing emails and tested things were set up OK by uploading this:

    <?php
    $address = "your_email@your_host.com";
    
    $subject = 'Test email.';
    
    $body = 'If you can read this, your email is working.';
    
    echo "Attempting to email $address...<br />";
    
    if (mail($address, $subject, $body)) {
            echo 'SUCCESS!  PHP successfully delivered email to your MTA.  If you don\'t see the email in your inbox in a few minutes, there is a problem with your MTA.';
    } else {
            echo 'ERROR!  PHP could not deliver email to your MTA.  Check that your PHP settings are correct for your MTA and your MTA will deliver email.';

    The test went well and the email was sent and received perfectly.

    So... I tried the invitation form again and realised that the invitations are going into the spam folders (yet the simple test above didn't??). In the spam folder I get an undeliverable message:

     

    This is the mail system at host qproxy2.mail.unifiedlayer.com.
     
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
     
    For further assistance, please send mail to postmaster.
     
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
     
                      The mail system
     
    <email  address invited >: host gmail-smtp-in.l.google.com[76765432]
        said: 550-5.7.1 Unauthenticated email from yahoo.co.uk is not accepted due
        to domain's 550-5.7.1 DMARC policy. Please contact the administrator of
        yahoo.co.uk domain 550-5.7.1 if this was a legitimate mail. Please visit
        550-5.7.1  https://support.google.com/mail/answer/2451690 to learn about
        the 550 5.7.1 DMARC initiative. t136si886426pgc.538 - gsmtp (in reply to
        end of DATA command)
     

    You have been invited to join FriendsNow by Mark. They included the
    following message:

    Hi,

    I want to invite you to join my network here on FriendsNow.

    To join, click the following link:

    Link

    You will automatically add them as a friend when you create your account.

    ------

    (I've changed things in itallics)

    So I read about the DMARC initiative and think maybe my invitation looks like spam! 

    So I want to modify that form! In my browser I've seen the source code behind the invitation page (/invite) and reckon I can make some changes that might help. I want to add some boxes, maybe a Honeypot and some kind of simple anti-robot thing (I've done things like this on other sites I manage). BUT I can't find the file with that source code I see in my browser in my elgg file system! I've looked in the mod/invitefriends file and can't find that file with the email address and "You will automatically add them as a friend when you create your account".

    Really need your help here - think I'm making progress... but..

    Thanks,

    Striver

  • Sending the test email probably works because the email address used as sending address is from the server domain, i.e. email sender address domain and sending email server domain match. I guess you are using a different email address domain (yahoo.co.uk) as the site email address. Then sending server and this domain do not match and Google (and other mail providers probably too) will not deliver the mails as they suspect unauthorized usage of the origin mail server.

    Best would be to use a site email address that is from your Elgg site's domain to avoid this problem (additionally enabling some authentication functions on the server like SPF and Domain Keys to allow the email providers to verify the origin of the mail).

    If you can't use an email address from your site's domain for whatever reason (really no other choice?) you would have to use a plugin that allows for sending site emails via SMTP. I don't know right now though if there's any plugin available that works on Elgg 2.x (there are some old plugins but they will likely no longer work on Elgg 2.x as no one updated them).

  • Hey iionly,

    You have cracked it! Thank you very much!

    As you suggested in your first and second paragraphs I changed the site email address (used when sending system emails) via Administration>Configure>Settings>Basic Settings and the invitation emails are now working fine (at least in my test invites). Do you think it is important that I should also attempt to change the authentification functions, as you suggested?

    Thank you,

    Striver

  • The verification mechanisms i've mentioned are to be configured on the server. These are not under the control of Elgg. You might want to get in contact with the support of your webhoster to ask which options you have and how they would have to be configured because it depends on what tools are used for server admininistration (CPanel, WHM or something else). Some verification mechanisms can probably only be set up by the webhoster anyway, for example a PTR record which would allow reverse DNS lookups. The verification options might not become useful immediately but they might be necessary in the long run in any case to prevent your email server (based on IP address or domain name) getting a bad rating for sending too much "spam" (false positives as the mails like account verification emails or other email notifications getting out to your users are wrongly identified as spam just because the content/wording is often quite similar or even the same). By using SPF (Sender Policy Framework), DKIM (Domain Keys Identified Mail) and having a valid PTR record you provide the email providers the necessary info that they can verify the origin of the valid mails sent from your server and they won't wrongly mark them as spam or in the worst case even set your server on a blacklist (you would be able to remove your server from blacklists but still it's better to not getting listed in the first place).

  • Hi iionly,

    Once again, I followed your instructions. Now all is well on the verification front.

    Thanks hugely... again,

    Striver

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking