I have recently installed Elgg fresh out-of-the-box, so to speak, but am having a problem with avatars mysteriously disappearing. I can load them, and they look fine, but next day (or so) they're gone, if I leave 'The full path of the data directory:' in Advanced Settings under Administrator set to '/tmp/' which was the default when I did the install using SimpleScripts. If I change it to '/data/' I can't even upload. The system says I did it successfully, but there's nothing there but the Question Mark symbol.
I have read several threads and the Wiki and tried putting a '/data/' directory outside the root install of Elgg, but it doesn't help, even with 775 permissions set.
The install was done using SimpleScripts on a Bluehost virtual Lnus server. SimpleScripts tells me everything is just ticketyboo and tells me the installation is at www.corballis.co.uk (so it tells me the URL of the site, not the directory listing).
I host several sites with Bluehost and www.corballis.co.uk is one of these. They all sit in their own directory under the structure:
[root]/public_html/[folder]
so, in this case it's:
[root]/public_html/corballis/
that is the root install for elgg, I believe. Certainly that is the root for the url: www.corballis.co.uk
I belive that /data/ should be in the following place:
[root]/public_html/data/
going by the documentation I've read (e.g. http://docs.elgg.org/wiki/Installation and http://docs.elgg.org/wiki/No_images#Migrated_installation_with_new_data_directory_location) but out of frustration / desperation, I've also tried putting it here:
[root]/data/
In each case I've given the folder 775 permissions. I haven't tried 777 as I don't want malicious people running nasty scripts on my server.
No other functionality of my site is affected, just the ability to upload pictures (people seem to be able to upload files, just fine). It is very frustrating and has taken up oodles of time so far, which I don't really have. That aside, I seem to have drawn a complete blank and am now out of ideas :(
I have turned logging on, temproarily, and I can see this error in php, but it doesn't mean a whole lot to me:
/home4/univert3/public_html/corballis/pages/account/error_log:[28-May-2013 19:33:54] PHP Fatal error: Call to undefined function elgg_get_config() in /home4/univert3/public_html/corballis/pages/account/register.php on line 16
/home4/univert3/public_html/corballis/error_log:
OR (n_table.owner_guid = -1)
OR (
n_table.access_id = 0
AND n_table.owner_guid = -1
)
) and n_table.enabled='yes'))) AND ( (e.access_id IN (2)
OR (e.owner_guid = -1)
OR (
e.access_id = 0
AND e.owner_guid = -1
)
) and e.enabled='yes') ORDER BY n_table.time_created desc, n_table.id LIMIT 0, 3 results returned from cache (hash: row_to_elggannotation0SELECT DISTINCT n_table.*, n.string as name, v.string as value FROM lkz_annotations n_table JOIN lkz_entities e ON n_table.entity_guid = e.guid JOIN lkz_metastrings n on n_table.name_id = n.id JOIN lkz_metastrings v on n_table.value_id = v.id JOIN lkz_metastrings msn on n_table.name_id = msn.id WHERE (e.guid IN (525)) AND (((msn.string IN ('generic_comment')) AND ( (n_table.access_id IN (2)
OR (n_table.owner_guid = -1)
OR (
n_table.access_id = 0
AND n_table.owner_guid = -1
)
) and n_table.enabled='yes'))) AND ( (e.access_id IN (2)
OR (e.owner_guid = -1)
OR (
e.access_id = 0
AND e.owner_guid = -1
)
) and e.enabled='yes') ORDER BY n_table.time_created desc, n_table.id LIMIT 0, 3)
[01-Jun-2013 09:34:04] NOTICE: default/login/extend view does not exist.
[01-Jun-2013 09:34:04] NOTICE: default/login/extend view does not exist.
[01-Jun-2013 09:34:04] NOTICE: default/metatags view does not exist.
[01-Jun-2013 09:34:04] NOTICE: default/footer/analytics view does not exist.
[01-Jun-2013 09:34:04] NOTICE: Page /index.php/forum/ generated in 0.413540124893 seconds
[01-Jun-2013 09:34:04] NOTICE: DB Queries for this page: 58/home4/univert3/public_html/corballis/engine/handlers/error_log:
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT * from lkz_metastrings where string= BINARY '1' limit 1 results cached (hash: 0SELECT * from lkz_metastrings where string= BINARY '1' limit 1)
[01-Jun-2013 09:33:26] NOTICE: ** Cacheing string '1'
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT * FROM lkz_users_entity as e
WHERE (
e.guid = 33
AND e.admin = 'yes'
) results returned from cache (hash: 0SELECT * FROM lkz_users_entity as e
WHERE (
e.guid = 33
AND e.admin = 'yes'
))
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT am.access_collection_id FROM lkz_access_collection_membership am LEFT JOIN lkz_access_collections ag ON ag.id = am.access_collection_id WHERE am.user_guid = 33 AND (ag.site_guid = 1 OR ag.site_guid = 0) results returned from cache (hash: 0SELECT am.access_collection_id FROM lkz_access_collection_membership am LEFT JOIN lkz_access_collections ag ON ag.id = am.access_collection_id WHERE am.user_guid = 33 AND (ag.site_guid = 1 OR ag.site_guid = 0))
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT ag.id FROM lkz_access_collections ag WHERE ag.owner_guid = 33 AND (ag.site_guid = 1 OR ag.site_guid = 0) results returned from cache (hash: 0SELECT ag.id FROM lkz_access_collections ag WHERE ag.owner_guid = 33 AND (ag.site_guid = 1 OR ag.site_guid = 0))
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT * FROM lkz_users_entity as e
WHERE (
e.guid = 33
AND e.admin = 'yes'
) results returned from cache (hash: 0SELECT * FROM lkz_users_entity as e
WHERE (
e.guid = 33
AND e.admin = 'yes'
))
[01-Jun-2013 09:33:26] NOTICE: DB query SELECT count(DISTINCT e.guid) as total FROM lkz_entities e JOIN lkz_metadata msg_toId on e.guid = msg_toId.entity_guid JOIN lkz_metadata msg_readYet on e.guid = msg_readYet.entity_guid JOIN lkz_metadata msg_msg on e.guid = msg_msg.entity_guid WHERE msg_toId.name_id='99' AND msg_toId.value_id='46' AND msg_readYet.name_id='102' AND msg_readYet.value_id='10' AND msg_msg.name_id='105' AND msg_msg.value_id='4' AND (e.owner_guid IN (33)) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes') results cached (hash: 1SELECT count(DISTINCT e.guid) as total FROM lkz_entities e JOIN lkz_metadata msg_toId on e.guid = msg_toId.entity_guid JOIN lkz_metadata msg_readYet on e.guid = msg_readYet.entity_guid JOIN lkz_metadata msg_msg on e.guid = msg_msg.entity_guid WHERE msg_toId.name_id='99' AND msg_toId.value_id='46' AND msg_readYet.name_id='102' AND msg_readYet.value_id='10' AND msg_msg.name_id='105' AND msg_msg.value_id='4' AND (e.owner_guid IN (33)) AND (e.site_guid IN (1)) AND ( (1 = 1) and e.enabled='yes'))
[01-Jun-2013 09:33:26] NOTICE: default/metatags view does not exist.
[01-Jun-2013 09:33:26] NOTICE: default/footer/analytics view does not exist.
[01-Jun-2013 09:33:26] NOTICE: Page /_graphics/icons/default/master.png generated in 0.215296030045 seconds
[01-Jun-2013 09:33:26] NOTICE: DB Queries for this page: 29
[01-Jun-2013 09:33:26] NOTICE: DB query REPLACE INTO lkz_users_sessions
(session, ts, data) VALUES
('**********', '1370100806', '__elgg_session|s:32:\"41f8e76a8e49bcd33dfed3fce8ccb53f\";msg|a:0:{}user|O:8:\"ElggUser\":8:{s:15:\"\0*\0url_override\";N;s:16:\"\0*\0icon_override\";N;s:16:\"\0*\0temp_metadata\";a:0:{}s:19:\"\0*\0temp_annotations\";a:0:{}s:24:\"\0*\0temp_private_settings\";a:0:{}s:11:\"\0*\0volatile\";a:0:{}s:13:\"\0*\0attributes\";a:25:{s:4:\"guid\";i:33;s:4:\"type\";s:4:\"user\";s:7:\"subtype\";s:1:\"0\";s:10:\"owner_guid\";s:1:\"0\";s:9:\"site_guid\";s:1:\"1\";s:14:\"container_guid\";s:1:\"0\";s:9:\"access_id\";s:1:\"2\";s:12:\"time_created\";s:10:\"1369059513\";s:12:\"time_updated\";s:10:\"1370095898\";s:11:\"last_action\";s:10:\"1370100805\";s:7:\"enabled\";s:3:\"yes\";s:12:\"tables_split\";i:2;s:13:\"tables_loaded\";i:2;s:4:\"name\";s:14:\"Toby Corballis\";s:8:\"username\";s:5:\"admin\";s:8:\"password\";s:32:\"************* my stars in case this string is useful to hackers ****************\";s:4:\"salt\";s:8:\"efb3e4ff\";s:5:\"email\";s:20:\"tcorballis@[emaildomain].com\";s:8:\"language\";s:2:\"en\";s:4:\"code\";s:0:\"\";s:6:\"banned\";s:2:\"no\";s:5:\"admin\";s:3:\"yes\";s:16:\"prev_last_action\";s:10:\"1370100805\";s:10:\"last_login\";s:10:\"1370095898\";s:15:\"prev_last_login\";s:10:\"1370021705\";}s:8:\"\0*\0valid\";b:0;}guid|i:33;id|i:33;username|s:5:\"admin\";name|s:14:\"Toby Corballis\";')
That's all gobbledegook to me, I'm sorry to say, but I'm guessing it could be part of the issue or rather point to what the issue is? By the way, the asterisks were real values that I've replaced in case they mean something to a hacker, though I'm guessing they don't.
Any help greatfully received on this one.
Oh, and here are the technical details in case they're important:
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- lim@limdauto

lim - 0 likes
- Matt Beckett@Beck24

Matt Beckett - 0 likes
- iionly@iionly

iionly - 0 likes
- Toby Corballis@tobycorballis

Toby Corballis - 0 likes
- the # in home# is a number (but if it's zero then it won't be present); and
- username is your account name, i.e. the name you log into Bluehost with.
- Matt Beckett@Beck24

Matt Beckett - 0 likes
You must log in to post replies.I had the same problem way back then as well but on Windows with XAMPP. Worked fine on Bluehost (?) I believe there was a problem with absolute path to the file because I remembered having to append $_SERVER['DOCUMENT_ROOT'] to the path of a static file on windows if I wanted to serve it directly but must remove it once I moved the code to Bluehost.
I don't know if it's related to your question. Just want to throw it out there.
The problem is that your data directory is /tmp
I don't know why they would set it up that way, as tmp is exactly what it sounds like, temporary. The system will delete files from there on a schedule - and once the file is deleted Elgg can't find it so falls back to the default question mark.
you need to use a permanent location for your data directory
[root]/data will work - you need to make sure the directory has read/write permissions for APACHE!
also make sure when you change the dataroot on your elgg system it is the correct absolute location and has the trailing slash
I would have said the same regarding /tmp as Matt.
Regarding where to place the data directory: do you mean with
[root]/data
the same as
/data ?
As you mentioned you already tried it with a folder in [root]/data I suspect that it's not the same. But Elgg needs the full path to the data directory and therefore it won't work to enter /data/ in the input field for the data directory when [root] stands for a filepath that is part of the full path. You would need to provide this part of the path to the data directory, too.
I'm not sure about the [root]/public_html/data/ location to be used as data directory. Normally the public_html folder would the document root folder of your domain. But maybe Bluehost uses some unconventional configuration on their servers that would make for example [root]/public_html/corballis/ to the document root. Nonetheless, [root]/public_html/data/ seems not the right place to create the data directory to me as you should create it outside the document root tree in any case.
If you fail to get it working I would suggest to ask Bluehost where you are able to create a directory outside the document root directory of your domain. They should know best - at least better than anyone here who is not informed about any specific Bluehost server settings. If you create the directory via a administration backend of your webspace where [root] is used as a placeholder you could ask the hoster support what [root] is a placeholder for to be able to enter the correct full path to the data directory in Elgg. Also, I would ask them if they use the open_basedir directive in their server configuration. If this is the case - and the path to the data directory is not included in the list of allowed directories of this directive, the access to this data directory will fail.
Thankls for the replies everyone. Your suggestions set me off down the right path (please excuse the pun). I am posting here in case anyone else with a Bluehost account encounters the same issue as me. The issue is that the full path to your installation is not revealed in the Advanced Settings or in the Simple Scripts information. The actual path to an installation takes the form:
... if, like me, your domain is an addon domain name, where:
You can find the absolute path by going to your main cPanel page and scrolling to the bottom left, then clicking on expand stats. (there are also instructions here)
So, in my case I had to expand [root] to the right value and then ensure I had a /data/ directory as follows: [root]/public_html/data/ (because it is an add on domain - if it's your main domain then it would be [root]/data/). Oh, and I had to ensure I had 775 set as the access permissions.
I hope all of the above makes some kind of sense.
It all seems to be working now, but if that solution doesn't turn out to be right, I'll update here.
Quite why they do a default of /tmp/ when that would be inaccessible to me as a user is beyond me (inaccessible because it would be: home#/data/ and I can never access that directly myself.
Glad you go it working, however chances are public_html is accessible to anyone with an internet connection - you should not have your data directory there.
Try /home/[username]/elggdata/ or something