Installing and upgrading help

Redirecting to installation page

 
Picture of Alberto PM
Redirecting to installation page
 

Hello.

My Moodle site was working perfectly but when I tried to browse to it last week I get this page first (picture1) and this other (picture2a and picture2b) after clicking 'Continue'.

I don't know what could be happen and how to solve it...

I appreciate so much if you can help me.


Thanks in advance




 
Average of ratings: -
Picture of Alberto PM
Re: Redirecting to installation page
 

Picture2b


 
Average of ratings: -
Picture of Emma Richardson
Re: Redirecting to installation page
Documentation writersParticularly helpful Moodlers

Apparently you have started an upgrade or your config.php file is missing prompting a new installation.

 
Average of ratings: -
Picture of Ken Task
Re: Redirecting to installation page
Particularly helpful Moodlers

I don't understand ...  your second screen shot that shows the environment check indicates you have logged on as an admin level user.   How did you get to that environment screen if  the first screen shot shows the initial setup of a new Moodle?

Is a config.php file present in the location of your Moodle code directory?   Are the ownership/permissions on that file such that the user under which your web service runs can see it?  Also, are permissions on that file set to global all can at least read it?

If a config.php file isn't present, Moodle thinks it's a new install.

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Alberto PM
Re: Redirecting to installation page
 

Hello.

Thanks a lot Emma and Ken for your reply!

I don't understand it either. I'm not logged and the config.php file is in the (this is a line in config.php about directory permissions: $CFG->directorypermissions = 0755;) So, why is trying to upgrade if I haven't initiated that process?

And how can I avoid it and continue with working with the installation that I had? Everything seems to works fine since I started with my moodle site several months ago.

Any help will be appreciate!


Regards.

 
Average of ratings: -
Picture of Alberto PM
Re: Redirecting to installation page
 

See the folder content at picture3



 
Average of ratings: -
Picture of Alberto PM
Re: Redirecting to installation page
 

I've used backups to try to restore the site to the state of before this happened but I always get the same page...

If this is caused for an automatic upgrade, is it possible to disable it without loggin in as admin?



 
Average of ratings: -
Picture of Ken Task
Re: Redirecting to installation page
Particularly helpful Moodlers

Ok, I get it now ... moodle thought it was a new installation and you must have clicked on the first screen (the license) to continue ... moodle then goes to the environment check which you saw ... without logging on.  Thing about that ... moodle checks for existence of config.php ... no new install if it's there.   Hate those numbers for ownerships/permisions ... so humor me ... ssh into server and cd to the same public_html directory then do an:

ls -l

That will show a first column that has _rwx__r__r sort of things ... and the second 2 columns will show owner/group.

What does that look like on your server?

No, moodle doesn't have any 'autoupdate'.  But a/your hosting provider might!!!

I see an error_log file in there ... what does it contain?

What sort of hosting do you have?   Reason asked ... 'public_html' isn't normally where one would install apps on a VPS or dedicated host where customer was the only person using.   That directory has restrictions for 'user space' that the other known locations of apache ... /var/www/ (on centOS or even Ubuntu LSB now) ... /var/www/html/ don't have those same 'user_space' restrictions.   check the main config file for apache for the use of public_html and you will probably see it's restricted from lots of things ... moodledata might be located up one level from public_html and probably has an .htaccess file in it.

Where is moodledata? .... check config.php of the code.

The DB user you see in config.php of the code, does that user have all priv's to the DB to which Moodle is pointed?

Reason asked ... there are command line scripts in moodlecode/admin/cli/ that can address each of those checks and fix 'em .... *IF* the DB user has enough priv's.

And one more item ... I see an .htacess.... long named thing.   What is that?

Typical standalone VPS's with jsut one user, apache defines that file as just .htaccess ...  yours shows something like a customer ID or something else.

When first installed, how was it installed?  Manually or did you use some script provided by the hosting?

'spirit of sharing', Ken


 
Average of ratings: Useful (1)
Picture of Alberto PM
Re: Redirecting to installation page
 

Hi Ken!

You're clearing up a lot of things for me, thanks a lot!

I'm working in a shared hosting so I can't access to it via ssh.

My hosting provider says they don't have an autoupdate.

If you tell me which are the permissions the config.php file must have maybe I could change it... For example, only read and write only for owner and no permissions for group or users must be 600.


I see an error_log file in there ... what does it contain?

This is the contain in the file:

[05-Oct-2017 18:03:21 UTC] PHP Warning:  require_once(/home/alberto7/public_html/formacion/cache/lib.php): failed to open stream: No such file or directory in /home/alberto7/public_html/formacion/lib/setup.php on line 609

[05-Oct-2017 18:03:21 UTC] PHP Fatal error:  require_once(): Failed opening required '/home/alberto7/public_html/formacion/cache/lib.php' (include_path='/home/alberto7/public_html/formacion/lib/pear:.:/opt/alt/php70/usr/share/pear') in /home/alberto7/public_html/formacion/lib/setup.php on line 609


check the main config file for apache for the use of public_html and you will probably see it's restricted from lots of things ... moodledata might be located up one level from public_html and probably has an .htaccess file in it.

Yes, moodledata is located up one level from public_html an has an .htaccess file and this is its contain:

deny from all
AllowOverride None
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!

But I don't understand that: "check the main config file for apache for the use of public_html and you will probably see it's restricted from lots of things "

Where's that config file?, what must I look for?


Where is moodledata? .... check config.php of the code.

As I told you, I'm under a shared hosting and my moodledata is located up one level from public_html but I can't see a config.php file there...


The DB user you see in config.php of the code, does that user have all priv's to the DB to which Moodle is pointed?

I'm not clear on this question... But I think if the user I created in the DB is the one showed in the file and I gave it all priv's the answer is yes.


And one more item ... I see an .htacess.... long named thing.   What is that?

I suppose this one created each time I use a backup app by the hosting provider... It contains exactly the same code as .htaccess


When first installed, how was it installed?  Manually or did you use some script provided by the hosting?

Manually. My hosting provider has an script but I prefer to do it on my own.


Hope these answers can clarify you so you can help me to solve this issue...

Again, thank you so much for your help!


Regards.


 
Average of ratings: -
Picture of Ken Task
Re: Redirecting to installation page
Particularly helpful Moodlers

The file referenced in the error_log is code/lib/setup.php.

At the top of that file:

 * Holds the core settings that affect how Moodle works. Some of its fields
 * are set in config.php, and the rest are loaded from the config table.
 *
 * Some typical settings in the $CFG global:
 *  - $CFG->wwwroot  - Path to moodle index directory in url format.
 *  - $CFG->dataroot - Path to moodle data files directory on server's filesyst$
 *  - $CFG->dirroot  - Path to moodle's library folder on server's filesystem.
 *  - $CFG->libdir   - Path to moodle's library folder on server's filesystem.
 *  - $CFG->tempdir  - Path to moodle's temp file directory on server's filesys$
 *  - $CFG->cachedir - Path to moodle's cache directory on server's filesystem $
 *  - $CFG->localcachedir - Path to moodle's local cache directory (not shared $
 *
 * @global object $CFG
 * @name $CFG

Those, as you can see, if one compares what ends up on config.php actually
directly relate to the setup of a new installation.

The first line of the php error file points to is 609 and is a warning ) not a show stopper).

which is this:

require_once($CFG->dirroot.'/cache/lib.php');       // Cache API

You can see it says 'require' ... 

But the second line is a fatal error ... show stopper.

'failed opening' cache/lib.php

So check if there is a cache/lib.php file.

If it is not, ftp or whatever you do/use to get files to the server, that file
from your locally un-zipped copy of moodle 3.3.x.

While the remainder of the questions and responses might still need to be
addressed, let's start with the above.

Will say this ... moodle 3.3 -> at least a full featured moodle 3.3 probably
won't run everything on a shared host because shared hosting doesn't give
the client access to things they will need.

Since I don't host anything on a shared host, specifics as to how to configure many things are at the mercy of the provider.   You'll have to first consult with helpdesk of provider.   Granted, they probably don't know enough about moodle to answer many questions ... and if that's the case, why do they allow customers to install it?

Have a feeling that they will tell you that you must upgrade to a VPS on their system - and you might have to if Moodle 3.3 and future versions continue to be a problem for you.

'spirit of sharing', Ken


 
Average of ratings: Useful (1)
Picture of Alberto PM
Re: Redirecting to installation page
 

Hi Ken!

I want to thank you because without your help I wouldn't have been able to solve this issue.

After two days of dispute with my hosting provider, they recognized that they had made some changes that had caused the problem and finally they fixed it.

Hosting providers usually says "maybe you've changed something, restore a backup", "perhaps there's a problem with that version of moodle, try with another one" and so on... But referring them to your post finally they responded to my request.


So thank you so much!


Alberto.

 
Average of ratings: -
Sketch...
Re: Redirecting to installation page
Particularly helpful Moodlers

One of the reasons why it's better to host with one of these Moodle Partners. They know what's required for Moodle hosting...

 
Average of ratings: -
Picture of Ken Task
Re: Redirecting to installation page
Particularly helpful Moodlers

Welcome.   Luis is correct in that, if, in the future, you have issues with moodle (which is forever upwards), you might have to seek a more 'moodle friendly' provider.

Am kinda curious so I'll ask ... did hosting provider tell you what happened and/or what they did to correct?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Alberto PM
Re: Redirecting to installation page
 
Hi!

You're right with hosting provider. Moodle partners is the better choice.


Ken, they said that the contents of the database tables were not well formatted.

But they also said that they restored the database to a previous copy and it was fixed but I'm not quite sure because I'd already done it and it wasn't working...



 
Average of ratings: -