Quantcast
Channel: Installing and upgrading help
Viewing all 46815 articles
Browse latest View live

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by Leon Stringer.  

The warning messages include the site domain so I've been able to try this and see these messages. But there's a "==" at the start of the output which doesn't look like part of a PHP error or output that Moodle would generate.

Is there any code added for debugging – I realise I suggested adding some, what if you revert that change? What does git status say?

Can you share config.php? You can attach the file to the reply, remove any information you don't want to share (e.g. database credentials).


HELP!! Crash after PHP update.

$
0
0
by Russ Ullrich.  

So I did something stupid.  I updated a production server's PHP from 7.1 to 7.4.11 on a Windows 2019 server with IIS.

Now I get the :
Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting.

I know that is a permissions error but NO permissions were changed and Moodle was fine before the PHP update.


PHP Manager displays the PHP 7.4.11 info page correctly.


HELP!!! 

Re: HELP!! Crash after PHP update.

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by John Schinnerer.  

Thanks Leon,

Crap, I scrubbed the domain.tld and then forgot to paste in the scrubbed version...anyhow...

The "==" at start of output has been there since the first instance of the generic error message, before I touched any code to force debug output. I assumed it was part of the error output string, a separator or something. Apparently not?

Config.php here was generated by the web UI install process. I have only added the code to force debug messages, the rest is as auto-generated:

---------------------

<?php // Moodle configuration file

unset($CFG);
global $CFG;
$CFG = new stdClass();

$CFG->dbtype = 'mariadb';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'my_db_name';
$CFG->dbuser = 'my_db_user';
$CFG->dbpass = 'secretpassword';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbport' => '',
'dbsocket' => '',
'dbcollation' => 'utf8mb4_unicode_ci',
);

$CFG->wwwroot = 'https://lms.mydoman.tld';
$CFG->dataroot = '/opt/moodle-data/';
$CFG->admin = 'admin';

$CFG->directorypermissions = 0775;

// Force a debugging mode regardless the settings in the site administration
@error_reporting(E_ALL | E_STRICT); // NOT FOR PRODUCTION SERVERS!
@ini_set('display_errors', '1'); // NOT FOR PRODUCTION SERVERS!
$CFG->debug = (E_ALL | E_STRICT); // === DEBUG_DEVELOPER - NOT FOR PRODUCTION SERVERS!
$CFG->debugdisplay = 1; // NOT FOR PRODUCTION SERVERS!

require_once(__DIR__ . '/lib/setup.php');

// There is no php closing tag in this file,
// it is intentional because it prevents trailing whitespace problems!

----------

Anything suspicious in that?

I have considered just nuking the whole install and starting over...but also hoping someone would know an obvious thing happening here with a fresh install so I wouldn't have to do that... tongueout

Re: HELP!! Crash after PHP update.

$
0
0
by Leon Stringer.  

Did php.ini from 7.1 get copied across? If not and you still have that file try adding it to the PHP 7.4.11 environment. There are some settings like fastcgi.impersonate = 1 that are needed with IIS. PHP Info shows which folder php.ini is being read from.

Re: HELP!! Crash after PHP update.

$
0
0
by Russ Ullrich.  

If I remember, we were at Moodle 3.5?

Yes, I did copy over the data from the PHP,ini.

Could it be the Moodle version?

Re: HELP!! Crash after PHP update.

$
0
0
by Russ Ullrich.  

I installed PHP 7.2.34 and got a slightly different error:
Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting.

Re: Jumping from moodle 3.1 version to 3.9

$
0
0
by Syed Ali.  

Got the latest of 3.1 code branch.
Now, should I upgrade my php 5.6 to 7.0 or first update moodle to 3.5 and then update php 7.0
Please suggest.

Re: HELP!! Crash after PHP update.

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by John Schinnerer.  

Thanks Alain, session files are being written to the moodle data directory, no apparent issues there.
What would that have to do with the "headers already sent" errors I am getting?

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by Leon Stringer.  

I was hoping there'd be something glaring as config.php could have been manually edited with characters inadvertently left behind but it looks fine.

Whilst the messages are warnings not errors they do mean that calling PHP function session_start() won't work and that's the problem.

These warnings occur when output or headers being sent to the browser prior to session_start() and that "==" looks like the extraneous output we could be looking for. Unfortunately "==" is very common operator in PHP so searching the source isn't workable. That's why I suggested git status as this would report files that have been changed or any unexpected files.

It's always worth purging Moodle's server-side cache with these sorts of problems, php admin/cli/purge_caches.php.

This doesn't look like a common problem with a fresh install so maybe starting from scratch is an option to work around this. It would be interesting to know the root cause though.

Re: Jumping from moodle 3.1 version to 3.9

Re: HELP!! Crash after PHP update.

$
0
0
by Ken Task.  

Wouldn't do them all at the same time.  PHP/MySQL when Moodle version requires them.  PHP upgrade then test.   If all ok backup db's, MySQL upgrade then test.   Finally Moodle.

'SoS', Ken


Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by Ken Task.  

What does 'I scrubbed the domain.tld and then forgot to paste in the scrubbed version"
mean?

error/An error occurred whilst communicating with the server
In the debug ... all warnings but ...

/content/fqdnofyourserver/html/moodle/
Was accessing your site without /html/moodle/ and get the moodle.
https://fqdnofyourserver/

Virtual apaches?
What's settings for apache - that relate to document root? and the config file for the FQDN?

'SoS', Ken

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by John Schinnerer.  

Thank Leon,
I did the purge_caches.php. That changed the error I get, so appears cached headers were the cause of the previous error.

NOTE the "==" that was output to my CLI however - same errant chars as on the web page:

...
john.schinnerer@malama:/content/lms.mydomain.tld/html/moodle$ sudo php admin/cli/purge_caches.php
==john.schinnerer@malama:/content/lms.mydomain.tld/html/moodle
...

So yeah there is something generating stray chars probably causing these errors, they show up on CLI output as well!
Git says:
------------------
$ git status
Refresh index: 100% (21186/21186), done.
On branch MOODLE_39_STABLE
Your branch is up to date with 'origin/MOODLE_39_STABLE'.

Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified: filter/algebra/algebra2tex.pl
modified: filter/tex/mimetex.darwin
modified: filter/tex/mimetex.exe
modified: filter/tex/mimetex.freebsd
modified: filter/tex/mimetex.linux
modified: lib/dml/mysqli_native_moodle_database.php

Untracked files:
(use "git add ..." to include in what will be committed)

lib/dml/mysqli_native_moodle_database.php.bak-2020-10-04

no changes added to commit (use "git add" and/or "git commit -a")
--------------------------------

I DID edit the mysqli_native_moodle_database.php file, to add the patch to fix this bug:
https://tracker.moodle.org/browse/MDL-69196

I did NOT modify those other files...would they have been modified by the install process?

I will do checkouts to put them back to original from branch and see what happens.

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by John Schinnerer.  

Thanks Ken,
"Scrubbed" Just meaning I wasn't intending to expose the real URL in my post, but forgot to use the sanitized text when pasting in the error trace.

PHP messages show the internal path, apparently, since that's where they see it from...?

html/moodle/ is root dir for the moodle site in apache config (root dir for subdomain lms.mydomain.tld), so that is what's intended.
If you try via web
https://lms.mydomain.tld/html/moodle
you will get 404 not found.

I think the stray "==" chars are key and causing the PHP error; not having any trouble hitting the moodle code via browser or I wouldn't be getting anything on the page, errors or otherwise.

Re: 3.9.2+ fresh install - installation session start failure, "headers already sent" PHP error

$
0
0
by Ken Task.  

Take a ganer at:

httpd -V ?

/usr/sbin/apachectl -t

/usr/sbin/apachectl -S

Do you have a sites-available directory in /etc/httpd/ directory for config of apache?

In sites-available do you have a config file the domain you are attempting to server?

Where is /content/ coming from?

'SoS', Ken


Re: HELP!! Crash after PHP update.

$
0
0
by Russ Ullrich.  

So I've upgraded to:
Moodle 3.9+ and MySQL 8

The site runs fine under PHP 7.2.34.
When I try 7.3.23 or 7.4.11 I get the "Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting." error.

I've even copied the 7.2 php.ini file into the other version folders just to try to get it to work with no luck.

Re: HELP!! Crash after PHP update.

$
0
0
by Ken Task.  

That 'fatal error' relates to location/writability to moodledata and all subdirectories/files in there.

The user under which your web service runs needs read/write on moodledata ... recursively.

Copying ini files from old versions to new versions is a bad idea.

Rather than relying on what moodle reports, check your true web server logs ... especially the web servers error log.

'SoS', Ken


Re: HELP!! Crash after PHP update.

$
0
0
by Russ Ullrich.  

I was just trying the older ini to see if it might work. Agreed, bad idea.

Trying to understand...
How can it be anything other than the PHP install if the site runs fine under PHP 7.2.34 but without changing anything else but to PHP 7.3.23 it throws the error. Doesn't it have to be the ini?
Viewing all 46815 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>