Forums | Mahara Community

Support /
Fresh installation of 19.10.1 fails


Thomas Kollewe's profile picture
Posts: 13

18 February 2020, 23:16

Hi,

I'm trying to install Mahara but it already fails at the first point with the message "Upgrade failed".

I then tried the CLI installer and this gives me the following message:

Fatal error: Can't use function return value in write context in /home/staff_homes/path_to/my_directory/public/mahara/lib/mahara.php on line 166

I'm trying to install on a server from my university with

  • PHP 7.2.27
  • MySQL 8.0.18
  • Apache/2.2.15 (Red Hat) DAV/2 mod_fcgid/2.3.9 mod_fastcgi/2.4.6 mod_ssl/2.2.15 OpenSSL/1.0.1e-fips mod_perl/2.0.4 Perl/v5.10.1
  • Client Version: libmysql - 5.1.73

Although I edited the config.php to write and show log there's no additional log file created.

Thanks in advance!

Thomas

Robert Lyon's profile picture
Posts: 774

19 February 2020, 10:26

Hi Thomas,

By the looks of things you will need to change the following in your code:

https://reviews.mahara.org/#/c/10765/1/htdocs/lib/mahara.php

Let me know if that helps

Cheers

Robert

 

Thomas Kollewe's profile picture
Posts: 13

19 February 2020, 22:05

Hi Robert,

 

thanks for your help. The problem for line 166 seems to be solved. Unfortunately now line 5693 causes the same error:

Fatal error: Can't use function return value in write context in /home/staff_homes/path_to/my_dir/public/mahara/lib/mahara.php on line 5693

 

$ sed '5693q;d' lib/mahara.php
$policy = !empty(get_config('passwordpolicy')) ? get_config('passwordpolicy') : '8_ulns';

 

Kind regards,

Thomas

 

 

Robert Lyon's profile picture
Posts: 774

20 February 2020, 8:31

Hi Thomas,

Thank you for letting me know.

I've updated the patch https://reviews.mahara.org/#/c/10765/ to fix up other places in the code where this error could occur when trying to read a config value and check it is empty at the same time.

It includes a fix for the line you mentioned

Cheers

Robert

 

Thomas Kollewe's profile picture
Posts: 13

20 February 2020, 22:08

Hi Robert,

Thank you for taking time and your work.

Unfortunately there's still a problem in 

/auth/user.php on line 1361

$ sed '1361q;d' auth/user.php
$institutions = !empty($this->get('institutions')) ? array_keys($this->get('institutions')) : array('mahara');

 

Kind regards,

Thomas

 

 

Thomas Kollewe's profile picture
Posts: 13

26 February 2020, 22:55

Hi,

are the problems, that I encounter caused by the shared server of my university or are they just within Mahara?

 

Kind regards,

Thomas

 

Robert Lyon's profile picture
Posts: 774

27 February 2020, 9:10

Hi Thomas,

The errors that you experienced used to happen for PHP older than version 5.5 - see https://www.php.net/manual/en/function.empty.php

And in most of the Mahara code we had adjusted things so they worked with PHP < 5.5 back in the day.

But recently that error was not occurring as PHP empty() function could handle expressions, rather than only variables. 

So some recent code was not written the old way. In the patch I created it does the code in the old way. Slightly more long-winded but otherwise doing the exact same thing.

You say your PHP version is 7.2 - can I get you to double check by going to your Mahara site and looking in:

Admin Home (wrench icon top right) -> Register and expand the 'Data included' area and find the 'phpversion' value. This will tell you what Mahara believes it is using- is that still 7.2?

Cheers

Robert

Thomas Kollewe's profile picture
Posts: 13

27 February 2020, 20:08

Hi Robert,

Unfortunately I can't check the PHP Version in Mahara because it still fails to install due to the error I described in Post #7.

Here is the list of the installed modules in the server that says it is PHP 7.2.28 :

http://modules.cgi-host2.rz.uni-frankfurt.de/

 

Kind regards 

Thomas

Thomas Kollewe's profile picture
Posts: 13

04 March 2020, 3:41

Hi Robert,

is there any chance that my problem in auth/user.php can be solved?

 

$ sed '1361q;d' auth/user.php
$institutions = !empty($this->get('institutions')) ? array_keys($this->get('institutions')) : array('mahara');


Thanks,

Thomas

Robert Lyon's profile picture
Posts: 774

04 March 2020, 11:19

Hi Thomas,

I've updated this patch https://reviews.mahara.org/#/c/10765/

Try it out and let me know how it goes

Cheers

Robert

16 results