Elgg will not run

Hello,

I think what is preventing the site from working is the .htaccess. I had to delete it, in order to install Elgg. After installing, it now gives an error message whether .htaccess is in there or not. If .htaccess is deleted, it gives a 400 error; if .htaccess is there, it gives an "Application error An error occurred in the website and your page could not be displayed. If you are the website owner, check your logs for details." message.

Does anyone know why this is happening?

  • I guess there's either mod_rewrite not enabled at all or not fully working. It's necessary that

    AllowOverride All

    is set for the install directory in the Apache config. As you are very likely unable to change the config of Apache, you can't do much here apart from asking the support if it's set or not.

    You can try to set

    RewriteBase /

    in Elgg's .htaccess file (just uncomment this line). Some people with issues on 000webhost seemed to have some luck with setting the rewrite base like this. It will only make sense if you haven't installed Elgg in a subdirectory as in this case setting the rewrite base would be necessary anyway (as described in the comment in .htaccess).

    If it still doesn't work, you might want to use another hoster as 000webhost seems not a good choice for Elgg (at least judging from the problems people seem to have with installing Elgg there).

  • Hello,

    I have the rewritebase / already done, but it didn't fix it.

    Unbelievably, a staff member from 000webhost looked at my account, and it miraculously all worked perfectly! Then, suddenly, it stopped working again. When I asked him what he had changed, he couldn't remember! He said he was testing things in the .htaccess file, but could not remember what it was he changed that caused it to work. So now, its back with error messages!

  • Comment out the AllowOverride directive. This is commonly not allowed on shared hosting, and Apache 500s if you try.

  • It's not "unbelievable", it's utterly ridiculous. There aren't that many things you could modify in .htaccess in the first place that would even make sense to test or would make it working. So, not remembering what made it working is absurd.

    I don't see any chance to give any good advice without knowing what's wrong, i.e. without an error log. The line "RewriteBase /" is just a wild guess as it seemed to have helped someone who also had a problem with getting Elgg to work on 000webhost. Have you uncommented the already existing line or added the line somewhere on your own? The line needs to be added at the correct place in .htaccess, i.e. where it is already (but just commented out). And if you have Elgg installed in a subdirectory, "RewriteBase /" won't work anyway. In this case you would need to add "RewriteBase /subdirectory/" as described in the comment in .htaccess.

    I would have made another suggestion. But as you said you are trying it with Elgg 2.3.3 this other possible reason for the fail is no longer a problem.

    The AllowOverride directive wouldn't work in .htaccess. It's a Apache config file setting. If this setting is not made in the Apache config of 000webhost, simply forget about trying to host your Elgg site there. If the support is not able to provide any helpful input, forget about hosting your site there. I would even say forget about any free hosting / shared hosting. They are not cheap without a reason but because there are some limitations in what you are allowed to do with regards to configuration and what to host. And Elgg is not a simple html site but has some (reasonable and valid) requirements with regards to server configuration and performance requirements.