Forums | Mahara Community

Support /
Installation failing: fatal PHP error


03 July 2020, 20:22

Hello :)

I tried the installation on a virtual machine with 100GB virtual hardDisk, 4GB Ram, Ubuntu Linux Server Version 20.04., Apache Version 2.4.41, PostgreSQL Version 12.2. and PHP Version 7.4.3.

I followed most of the time the 2 tutorials:

I moved the mahara files in /var/www/mahara. Data should be stored in /var/data/mahara.

 

I tried to install Mahara but I'm experiencing a fatal PHP error. The error massage isn't pretty meaningfull - it just points to a php line in htdocs/lib/errors.php of the function exception().

It does happen when I'm trying the installation

  • by opening the domain - nothing happens, just white screen and the error in the apache2 log, appearing every time I open the site
  • by "php admin/cli/install.php --adminpassword='examplepassword' --adminemail=youremailaddress" - same error msg like the one in the log when opening the domain in a webbrowser

 

Here's the apache error.log

Mahara-ErrorLog.png.2

 

That's my terminal when trying the installation via php admin/cli/install.php:

Mahara-ErrorLog2.png.1

 

I can clearly reach the server. For example: I copied the apache index.html to /mahara/htdocs and I can access it with my webbrowser via http://192.168.178.38/ indexApacheBackup. html. Other indicator is the entry in the apache log, everytime I open the domain. So I guess the routing isn't the problem.

 

Here's the loaded example html site in /var/www/mahara/htdocs:

Mahara-Error-Seite-laed.png.1

 

That's my mahara.conf:

Mahara_conf.png.1

 

 

config.php looks like this:

$cfg->wwwroot = 'http://mahara'; 
$cfg->dataroot = '/var/data/mahara'; 
$cfg->dbname = 'mahara'; 
$cfg->dbuser = 'mahara'; 
$cfg->dbpass = '[password]';

 

As you see, I've spend a few hours and tried a lot things, specially with the mahara conf.

 

Now I'm hoping I presented my problem detailled enough so someone can explain me the cryptographic problem of my webserver! :)

 

Thank you and greetings from Germany

Robert Lyon's profile picture
Posts: 773

05 July 2020, 20:53

Hi Martin,

What version of Mahara are you trying to install?

To help with the problem of not getting any useful error messages can you try making the following change to the htdocs/lib/errors.php file -> https://reviews.mahara.org/#/c/10661/2/htdocs/lib/errors.php

For the mahara.conf issues I tend to have

<VirtualHost *:80>
  ServerName mahara
DocumentRoot /var/www/mahara/htdocs
     
<Directory /var/www/mahara/>
    Options Indexes FollowSymLinks MultiViews
    Require all granted
  </Directory>

  ErrorLog /var/log/apache2/mahara-error.log
  LogLevel info

  CustomLog /var/log/apache2/mahara-access.log combined
  DirectoryIndex index.php index.html
</VirtualHost>

To access the site from the same server you will need to add row in your /etc/hosts file

127.0.0.1   mahara

If you are accessing it from another server / machine you will need to edit the hosts file in that machine to point to the correct machine, eg

123.456.78.90 mahara

Cheers

Robert

Robert Lyon's profile picture
Posts: 773

05 July 2020, 20:55

Hi Martin,

What version of Mahara are you trying to install?

To help with the problem of not getting any useful error messages can you try making the following change to the htdocs/lib/errors.php file -> https://reviews.mahara.org/#/c/10661/2/htdocs/lib/errors.php

For the mahara.conf issues I tend to have

<VirtualHost *:80>
  ServerName mahara
DocumentRoot /var/www/mahara/htdocs
     
<Directory /var/www/mahara/>
    Options Indexes FollowSymLinks MultiViews
    Require all granted
  </Directory>

  ErrorLog /var/log/apache2/mahara-error.log
  LogLevel info

  CustomLog /var/log/apache2/mahara-access.log combined
  DirectoryIndex index.php index.html
</VirtualHost>

To access the site from the same server you will need to add row in your /etc/hosts file

127.0.0.1   mahara

If you are accessing it from another server / machine you will need to edit the hosts file in that machine to point to the correct machine, eg

123.456.78.90 mahara

Cheers

Robert

06 July 2020, 4:17

Hello Robert,

 

thank you for your reply.

 

I'm trying to install Mahara 20.04..

 

I tried changing the htdocs/lib/errors.php file, but the code I see there isn't the code from your link.

The exception function looks like this in my mahara:

MaharaErrorsPHP.png

 

I tried to integrate your solution but id din't worked well.

MaharaErrorsPHP2.png

 

I still get the same Exception of the fatal PHP error that isn't pretty meaningfull.

 

I also changed my mahara.conf to your suggestion.

 

I already added the mahara domain in my /etc/hosts file with:

127.0.0.1   mahara

 

 

As I already said, I can ping and reach the server...

It's just this PHP error when i try the installation.

 

 

 

Robert Lyon's profile picture
Posts: 773

08 July 2020, 15:10

Hi Martin

I see in your code this bit:

 

interface MaharaThrowable {

...

}

That bit of code doesn't exist in core Mahara - can you try commenting it out / removing it and see if that makes any difference?

Cheers

Robert

08 July 2020, 20:01

Hi Robert,

 

I removed the function:

interface MaharaThrowable {

...

}

 

Didn't changed anything sadly.

 

Why should I have the wrong code?

I downloaded the 20.04. from https://launchpad.net/mahara/20.04.

 

Greetings

Martin

6 results