Multiple php versions with different moodle versions ([error] : FastCGI sent in stderr:)

Multiple php versions with different moodle versions ([error] : FastCGI sent in stderr:)

by Nirosha Rathnayake -
Number of replies: 3

I am running a CentOS 7 server with nginx. I have installed both php 7.2 and 5.6 and working fine. 

With php 7.2, I have installed Moodle 3.xx and it works fine.

With php 5.6, I have setup more than 5 Moodle 2.7 websites as 'https://lms.xxxx.xxxx.xxx/website-name'. The problem is the moodle websites does not show properly. All the images are missing and everything shows in plain text.

Error log shows:

2019/06/17 16:45:11 [error] 7742#7742: *400 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: data in /path/to/moodle/installation/cache/stores/file/lib.php on line 370" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET /xxx/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "xxx.xxx.xxx.xxx", referrer: "https://xxx.xxx.xxx.xxx/"

php 5.6 runs of port 9001. 

    location ~* \.php$ {

      fastcgi_pass 127.0.0.1:9001;

      include         fastcgi_params;

      fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;

      fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;

    }


In '/opt/remi/php56/root/etc/php-fpm.d/www.conf'

; Note: This value is mandatory.

listen = 127.0.0.1:9001


What could be the culprit?


Attachment moodle website.png
Average of ratings: -
In reply to Nirosha Rathnayake

Re: Multiple php versions with different moodle versions ([error] : FastCGI sent in stderr:)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Moodle 2.7... unsupported for over two years...
In reply to Nirosha Rathnayake

Re: Multiple php versions with different moodle versions ([error] : FastCGI sent in stderr:)

by Luis de Vasconcelos -
Picture of Particularly helpful Moodlers
Why are you installing Moodle 2.7 when 3.7 is available? 2.7 is 10 vesrions old!

Anyway... have you checked your Moodledata permissions?
In reply to Nirosha Rathnayake

Re: Multiple php versions with different moodle versions ([error] : FastCGI sent in stderr:)

by Ken Task -
Picture of Particularly helpful Moodlers

Aside from 2.7 being old and why ...

5 moodle 2.7's in directories
What's above them all?  A WordPress?  Which PHP is / seeing?

The error ... undefined ... and the referrer looks like the 5 moodles in subdirectories are not seeing php 5.6.  Whatever is on top of them using PHP 7 and not the PHP 5.6.  Version 2.7 won't run under PHP 7.x

2019/06/17 16:45:11 [error] 7742#7742: *400 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: data in /path/to/moodle/installation/cache/stores/file/lib.php on line 370" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET /xxx/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "xxx.xxx.xxx.xxx", referrer: "https://xxx.xxx.xxx.xxx/"

If the subdirectories are seen 5.6.x, then the following should show you that:

cd oneofthe2.7codedirs/
php -v
and/or
which php

Also, each moodle instance has it's own data directory - right?

Each moodle instance is running it's own cron job?

What happens, when in one of the 2.7's from the root of the code directtory you run:

php admin/cli/cron.php [ENTER]
or

php admin/cli/purge_caches.php

For that matter, if you are stuck running 2.7's, why have PHP 7 installed at all?

Your posting on StackOverFlow also shows something interesting ...

location /dataroot/ {

        internal;
        alias /var/www/html/lms-data/$rot-data;
    }
Is apache root /var/www/html/ ... why would one put /lms-data/$rot-data in a web accessible directory on purpose?

So in config of one of the 2.7's data directory has something like:

/$rot-data or what?

'SoS', Ken