Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
Hi,
are the problems, that I encounter caused by the shared server of my university or are they just within Mahara?
Kind regards,
Thomas
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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
Re: Fresh installation of 19.10.1 fails
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