Install.php tries to download

Install.php tries to download

Gary Anderson -
回帖数:8
Hi there, firstly apologies if this has been covered but any search string I tried was proving unsuccessful.

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
回复Gary Anderson

Re: Install.php tries to download

Maik Riecken -
Maybe PHP is disabled for the directory to which moodle has been installed to? This is often a problem with PHP as CGI.

Maik
回复Maik Riecken

Re: Install.php tries to download

Gary Anderson -
Sorry, I forgot to mention that the phpinfo file I have been running, plus a couple of other scripts, are all located in the same directory. Thanks for the response
回复Gary Anderson

Re: Install.php tries to download

Maik Riecken -
Two ideas:

install.php has wrong permissions or different owner/group settings
install.php is corrupt itself. Try to replace by an actual file from moodle.org.

regards,

Maik
回复Maik Riecken

Re: Install.php tries to download

Gary Anderson -
I was using the latest stable build instead of the latest stable release without realising so I have now tried using the latest stable release and I am getting a blank page upon visiting install.php

Any suggestions?
回复Gary Anderson

Re: Install.php tries to download

Ken Wilson -

Three suggestions:

  1. Clear out your PHP cache (as stated in http://docs.moodle.org/en/Upgrading_to_Moodle_1.8) by restarting your webserver if necessary.
  2. 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.
  3. 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

回复Ken Wilson

Re: Install.php tries to download

Gary Anderson -
I have manually completed the config file and at least I am getting some page output. I am getting an error

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?
回复Gary Anderson

Re: Install.php tries to download

Ken Wilson -

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.

回复Ken Wilson

Re: Install.php tries to download

Gary Anderson -
OK this has now been resolved through updating the configuration file manually. I'm going to try a moodle install with error reporting on my home server to see why install.php wasn't working as it isn't an ideal scenario

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