When I access install.php in my browser for a first-time install of Moodle it is asking me where I want to save the file. Now I know the first line of thought in this situation is whether PHP and Apache are set up correctly but I have a phpinfo file that is displaying and when I try and access any other PHP page it is displaying the content so it seems local to this file
Any tips, pointers or advice would be welcomed
Thanks
EDIT: PHP version 5.1.4
Three suggestions:
- Clear out your PHP cache (as stated in http://docs.moodle.org/en/Upgrading_to_Moodle_1.8) by restarting your webserver if necessary.
- Check your memory_limit value in php.ini. Moodle v 1.8 seems to have dramatically increased the amount of memory needed - try setting it to a very high value, e.g. 512M just to avoid any memory limit errors.
- You've probably done this already - but run through the suggestions in http://docs.moodle.org/en/Installation_FAQ#Why_are_all_my_pages_blank.3F also.
Also, turning on php debugging in your moodle/config.php file with these commands will help identifying any problems that php is having:
$CFG->debugdisplay=1;
$CFG->debug=2047;
Add these lines on the next line immediately *after* the unset ($CFG) command. If there is no config.php copy config-dist.php, rename as config.php and manually change the the file as described in http://docs.moodle.org/en/Configuration_file.
Error: Database connection failed.
It is possible that the database is overloaded or otherwise not running properly.
The site administrator should also check that the database details have been correctly specified in config.php
But the database settings are correct. I am presuming that this is because I set up config.php manually the installer hasn't had the chance to create the correct database tables?
That error is usually displayed before the installer tries to create the tables in the database. Are you sure that the database server and username/pwd combination are as you have created them? Check in these two documents:
http://docs.moodle.org/en/Installing_Moodle#Creating_an_empty_database and http://docs.moodle.org/en/Installation_FAQ#Error:_database_connection_failed.
The error is coming from the file lib/setup.lib. Try taking a look at this file around line 130. After the line error_reporting(0); add the line
$db->debug=true;
and change error_reporting(0) to error_reporting(7) - just to add more error reporting. Re-run the install.php file and note any details about the error message produced by PHP.
One final question: I hadn't set the permissions of moodledata correctly before visiting index.php so it failed first time round. I went back and changed the permssions then revisited index.php and everything went fine. Could someone please confirm the correct directory structure of moodledata for a standard installation of Moodle 1.8? Thanks