Welcome to Elgg's documentation
This is the place to find documentation on all aspects of Elgg. If you would like to contribute your own documentation please do; we want this to be a real community effort!
Common installation issues
From Elgg Documentation
99.99% of Elgg installation errors reported to us are the same handful of issues. Chances are, if you've got a problem, it can be solved below.
[edit] Turning 'Allow globals' Off
Elgg will detect if php 'allow globals' is turned on, and give you an error page. Elgg is designed to turn off 'allow globals' automatically, but currently (v0.9) this fails on Shared Servers (aka Shared Hosting), and unfortunately, the error message that results suggests four solutions that do not work. There are a number of options (discussed in detail at [1] (a good summary in comment 19)):
- The best solution is to force the site to be treated as php5, which has globals off by default. Simply add this line to your .htaccess (This has worked for a number of people with Shared Hosting on 1and1):
AddType x-mapp-php5 .php
- The other, less elegant solutions can be to use php.ini files, which can also be used to change php parameters in the folder they reside. But note - on some systems the php.ini will apply to only the folder it is in (place an appropriate php.ini file into EVERY directory and sub directory!), on other systems, it will apply to all sub-folders too (just place an appropriate php.ini file into your directory root). The php.ini file could contain the following:
register_globals = off memory_limit = 16M ; Maximum amount of memory a script may consume (8MB)
- Note: one other solutions is discussed which involves removing the checks for global variables within the elgg code. This is definitely not reccommended - it leaves your site insecure, makes it hard to ugrade, and it may not even work!
[edit] 404 errors for /username/, /username/weblog/, etc
The Elgg installation guide has a section on this.
If you can not get the rewritebase to resolve the issue, one solution is to place the htaccess file in the root directory. Then, prefix the rewrite_rules with the address of your subdirectory. As an example,
- Homepage Rule
RewriteRule ^([A-Za-z0-9]+)\/page\/?$ mod/folio/html/homepage.php?user=$1
turns into
- Homepage Rule
RewriteRule ^/elgg/([A-Za-z0-9]+)\/page\/?$ /elgg/mod/folio/html/homepage.php?user=$1
The above worked on godaddy's server Feb 2007 by Nathan Garrett. Be sure to put a blank htaccess file in the elgg directory.
Additionally, Mark Pearson contributed the following instructions:
Like many open source projects, Elgg uses so-called rewrite rules to create a URL that will end up extracting the information from the database to generate and display the required page on the fly. This relies on three components:
- The Apache server has to have a module called mod-rewrite installed (common)
- There needs to be a file called .htaccess in the root of executing code. This may need configuring.
- Apache needs to be told to execute the .htaccess by means of a directive in it's configuration file. This is the bit that is commonly forgotten about when installing and will lead to the 404 file not found errors.
Here's how to add or check the .htaccess directive:
Find the apache configuration file:
$ cd absolute path to httpd.conf
Edit the file:
$sudo vi httpd.conf
Adding the following:
<Directory "/absolute path to your elgg .htaccess file"> AllowOverride All </Directory>
Restart Apache:
$ apachectl restart
[edit] I get a blank screen, with no errors reported
By default, PHP is allocated 8Mb of memory by Apache. This is often not enough for large scripts like Elgg, which results in Apache bombing out and unhelpfully giving you a blank screen.
Here's a guide to increasing the memory limit for PHP on an Apache server, which should solve your problem.
You can also tweak your .htaccess file: To find out what's causing the crash, add the line
php_flag display_errors on
To increase the memory limit, add the line
php_value memory_limit 16777216
for a 16 megabyte limit, or
php_value memory_limit 33554432
for 32 megabytes, for example.
[edit] Internal Server Error 500
The web server doesn't like something, most likely in Elgg's .htaccess. You can find out more about the problem by looking at apache's error log.
[edit] Install says that Directory does not exist or can not be found
If you are running Elgg on a shared server, be certain that you have obtained the full path for the directory within your server. This is typically not just yoursite/elgg/ (etc) but rather /home/server/blahblah/yoursite... and so on.
You can obtain your path information by contacting your hosting provider directly or searching their knowledge bases for 'file paths' as it often will not be visible within an ftp program accessing a shared server. The Elgg admin panel at /_elggadmin/ will attempt to detect this automatically.
[edit] You have an error in your SQL syntax near 'COMMENT '...
You're using a version of MySQL older than Elgg's minimum requirement of version 4.1, and will need to upgrade that before installing Elgg.
Some hosting companies (e.g. 1and1) only offer MySQL 4.0.x or 5.x, so simply use a MySQL 5 database instead.
[edit] Database setup fails
Once PHP, Apache and MySql run, some people will get an error when running http://yoursite.com/elgg/index.php
The database cannot be setup properly and they get a message like this: 1101: BLOB/TEXT column 'title' can't have a default value ADOConnection._Execute(CREATE TABLE `elggmessages` ( `ident` int(11) NOT NULL auto_increment, `title` text NOT NULL default , `body` text NOT NULL..., false) % line 889, file: adodb.inc.php ADOConnection.Execute(CREATE TABLE `elggmessages` ( `ident` int(11) NOT NULL auto_increment, `title` text NOT NULL default , `body` text NOT NULL...) % line 38, file: datalib.php execute_sql(CREATE TABLE `elggmessages` ( `ident` int(11) NOT NULL auto_increment, `title` text NOT NULL default , `body` text NOT NULL...) % line 188, file: datalib.php modify_database(H:/htdocs/elgg/lib/db/mysql.sql) % line 43, file: dbsetup.php require_once(H:\htdocs\elgg\lib\dbsetup.php) % line 103, file: includes.php Error
This is due to a error in the file /lib/db/mysql.sql
the last create table statement has to lose its default expressions. change it, so it looks like this:
CREATE TABLE `prefix_messages` (
`ident` int(11) NOT NULL auto_increment,
`title` text NOT NULL,
`body` text NOT NULL,
`from_id` int(11) NOT NULL,
`to_id` int(11) NOT NULL,
`posted` int(11) NOT NULL,
`status` enum('read','unread') NOT NULL default 'unread',
PRIMARY KEY (`ident`),
KEY `from` (`from_id`,`to_id`,`posted`)
) ;

