On installing php as cgi and reinstalling Elgg the avatar and file upload problems have been soved. I thought it might be useful to understand a bit more about php as cgi. Apparently php normally runs as an apache module. Anyway, clues to what it is all about can be found at:
What’s the difference between running PHP as a cgi or as a module …
Should PHP run as a CGI script or as an Apache module?
Having come to a full stop on the Elgg installation until I can track down information on my avatar and file upload problem, I thought I would continue exploring WPMU. As we now have a successful BuddyPress installation at work now I have decided to copy what our tech team and users are doing there and add BuddyPress to http://terrywassall.org/blogs and take advantage of expertise and information they are gaining. The installation went fine and nothing reeally to report. I basically followed the instructions at http://wpmu.org/beginners-guide-to-buddypress/. I also activated the bbPress installation for forums. Every thing went well until I tried to upload a new avatar, for the admin account and for a user. In both cases I got the message:
Upload Failed! Error was: Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files/avatars/3. Is its parent directory writable by the server?
I tried creating the directory path manually on the server and gave everything in the path 777 permissions and I did manage to upload a new avatar for the user but when tried to do it for admin I got a message saying the file could not be uploaded. I have reset all the default avatars and deleted the folders I created manually so back to square one for the moment. I had to make a copy of the blogs.dir folder as I couldn’t open it or change permissions – it belongs to apache it seems. I renamed the original and have now reinstated that so it is exactly like the original installation again.
In addition, probably the same problem, on trying to upload a pdf file (a permitted file type for uploading) it looked as if it was uploading with a percentage cout down but then failed with the message:
Unable to create directory /var/www/vhosts/terrywassall.org/httpdocs/blogs/wp-content/blogs.dir/1/files. Is its parent directory writable by the server?
I think I will have to leave trying to get my Elgg installation going for the moment. It is taking too much time and help seems difficult to find. The latest problems are no tbeing able to uplaod new profile icons/avatars. They are reported as successfully uploaded but do not appear either as the new picture or in the preview and cropping area. This may be related to a file upload problem. Files appear to upload OK but when they are opened or downloaded they are empty. A txt file I uploaded was 0 bytes and a PowerPoint file had no slides in it. I’m sure all this is fixable. Certainly plenty of Elgg sites work fine. But the forums suggest a lot of people have a lot of problems!
For a private Elgg set up put the following somewhere in the engine/settings.php file:
$CONFIG->disable_registration = true;
The settings file was created by the install script and I couldn’t edit it. I managed to get in by copying it and renaming the uneditable version settings-original.php just in case. The added line has disabled public user registration from the home page and anywhere else it used to appear. I find admin can still create new users and a notification email is sent to the new users email address with the username and password.
I found this by Googling “elgg disabling user registration”. This came up with http://groups.google.com/group/elgg-development/browse_thread/thread/ec973efbb4b021de which also makes mention of a ‘walled garden’ plugin that might be worth a look. But further research suggest that this plugin disables admin’s ability to manually create new users.
Other possible tweaks for the config.php file are (none of which I have tried):
// The following should be set to false if you don’t want the
// general public to be able to register accounts with your
// Elgg site.
$CFG->publicreg = false;
// The following should be set to false if you don’t want users
// to be able to invite new users into the system.
$CFG->publicinvite = false;
// Set this to 1 to enable a walled garden – i.e., if you’re not logged in,
// all you can see is the login page.
$CFG->walledgarden = 0;
Does this last one need a plugin?
All these found with many others in:
http://cepadev.if.usp.br/trac/stoa/browser/trunk/elgg/config-dist.php
I haven’t yet got any response to my plea for help in the Elgg ‘Getting Started’ forum but after 30 minutes or so of browsing through earlier posts I think I have fixed the formatting, lack of css, problem. I found this referred to in an earlier post in this forum: http://docs.elgg.org/wiki/General_Troubleshooting. I turned the ‘simple cache’ off in site administration and immediately the formatting was fine! Turning the cache back on again immediately trashed the layout again. So I suppose I need to leave it off even though it says “Use simple cache (recommended)”
So all is well. I have registered a new user and the blogs work OK. Lots to learn about plugins and widgets and alternative layouts but looks very promising so far and will probably be worth the effort.
In the last post I reported that I tried to fix things by messing about with some of the settings and now couldn’t log in and I would delete the installation and start again. I have now tried to do this twice. The first time I just over-wrote the existing installation and deleted the .htaccess and engine/settings php files so the install script would have a fresh run at things. I left the existing db in place and hoped this would update if necessary. Needless to say it didn’t work. So I deleted this installation all over again but this time deleted and recreated the database and database user. I expect there is an easier way but this seemed to work. After uploading a fresh load of Elgg files again I set the necessary folder permissions for the install script to run ok and automatically create the settings and configuration files. The script ran, I entered the details, registered an admin account, logged in OK but the site is just the same as before – http://terrywassall.org/elgg/. B*****ks!
It’s as if the generated pages aren’t picking up any css or something. I still can’t find any references to this problem on the Web. I had no trouble installing WordPress, Moodle and phpBB. I had some initial problems installing WPMU but found and fix I needed with my first Google search a reference past onto me via Twitter supplied the rest. I will try posting a message to the Elgg forum.
Update: Posted the following message to the Getting Started group at Elgg.
————————————-
Hope this is the right place for this. I have just installed 1.6.1 following the installation instructions in the documentation area. All went as described until I got to the login page and into the site. No formatting or structure to the pages – http://terrywassall.org/elgg/. You’ll see what I mean if you look. Any ideas on what it is I need to do or have left undone? I have spent most of today searching for info on this and come up with nothing so far.
Whoops (update): after checking earlier messages in this discussion I tried changing to another view, choosing failsafe. Now I can’t log in or anything! I’ll look in the installation and db to see if I can change back to default view there. Any ideas gratefully received.
Further update: Sorry this is becoming a bit of a saga (appropriately enough). I found a line in the db where the view is specified, in the elggconfig table: view = s:8:”failsafe”;
I changed this back to view = s:8:”default”; and I can log in again. But still no formatting or layout, as if no css or anything else is being applied. I don’t like messing about in the database as I’m not sure what I’m doing.
As reported in the last post. I failed to install Elgg yesterday at http://terrywassall.org/elgg/. Since that post I tried to fix things by messing about with some of the settings and now I can’t log in! I shall be going for the equivalent of the ‘turn it off and on’ PC fix and so a complete reinstall ans start again.
Before that though I have tried another install in a subdomain of another web site I have – in elgg.terrywassall.net. This time I set up all the folder permissions so that the Elgg install script could create the necessary settings and configuration files automatically. This worked fine and all I had to do was fill in the database info and the path to the /data/ folder I had created. This is where things went wrong. The /data/ directory has to be created outside of the install path, i.e. in this case not in /httpdocs/, the document root of the subdomain. However, I found I did not have permissions to create folders at the same level as /httpdocs/. So I created it in /httpdocs/ and hoped for the best. I understand that you shouldn’t do this for security reasons. When I had filled in all the details required in the system settings form and clicked save I got an error message saying that the /data/ directory must be outside the installation path and that was that. I have now contacted my ISP and asked them to either give me permissions or to create the /data/ directory for me.
Attempted this evening to install elgg in http://terrywassall.org/elgg/. As you will see, there is no formatting and, although I am familiar with earlier versions up to 0.8, I cannot find how to find or change themes in the default installation. I assume it comes with at least 1 default theme. I understand themes are listed with plugins but there is nothing in the plugin list that sounds like a theme.
Up to this point installation went well. I downloaded and unzipped the files and used ftp to upload them into terrywassall.org/elgg/. I created a database and user as required. I created a data directory outside of the elgg root directory http://terrywassall.org/data/ and set the permissions asked for. Then I navigated to http://terrywassall.org/elgg/ and the install script ran as I had expected. I manually created the .htaccess and setting/engine.php files copying and pasting the text the installation script gave me. Then, on refreshing the browser to bring up the log in page I registered a user. According to the installation instructions the first user registered becomes the site admin. Having registered I logged in and enabled all the plugins that come with the install package. After spending an hour trying to work out if I could activate a theme and looking on the web for information I have given up for the evening. I’ll try again tomorrow and see if I can locate some help.