Forums | Mahara Community

Support /
Fresh installation of 19.10.1 fails


Thomas Kollewe's profile picture
Posts: 13

04 March 2020, 21:27

Hi Robert,

Thanks again!

The next is:

sed '3517q;d' lib/user.php
if (!$userobj->get('admin') && !$ok && empty(array_intersect($userinsts, $loggedininsts))) {

 

Kind regards,

Thomas

Robert Lyon's profile picture
Posts: 774

05 March 2020, 10:45

Hi Thomas,

Ok, I've updated the patch to fix that problem also

https://reviews.mahara.org/#/c/10765/4

Cheers

Robert

Thomas Kollewe's profile picture
Posts: 13

05 March 2020, 20:54

Hi Robert,

And the journey goes on ;b

 

I had some errors that complained about the [ in lib/phpmailer/src/PHPMailer.php in for example 

public $SMTPOptions = [];

 

I just replaced those with '' and it went on. Now I get an error complaining about a [ again but this time I don't know how to solve it.

Parse error: syntax error, unexpected '[' in /home/staff_homes/path/to/public/mahara/lib/phpmailer/src/PHPMailer.php on line 827
$ sed '827q;d' lib/phpmailer/src/PHPMailer.php
if (!in_array($this->Debugoutput, ['error_log', 'html', 'echo']) and is_callable($this->Debugoutput)) {

 

Kind regards,

Thomas

Robert Lyon's profile picture
Posts: 774

06 March 2020, 8:59

Hi Thomas,

The phpmailer is a third party plugin and so will not fix those - but for the places you see [ ] without any variable before them they should be changed to array(), eg:

public $SMTPOptions = array();

and

array('error_log', 'html', 'echo')

Hope that helps

Robert

Thomas Kollewe's profile picture
Posts: 13

21 March 2020, 3:18

Hi Robert,

I finally did it: Mahara is installed :)

The problem was that my university didn't point php to php72 properly and thus the installation always used php 5.3. :/

 

Now I still get the following warning:

[WAR] b0 (lib/mahara.php:3593) is_readable(): open_basedir restriction in effect. File(/proc/loadavg) is not within the allowed path(s): (/var/www/my_path/data/public:/var/www/my_path/tmp:/var/www/my_path/log)

 

What can I do about this (and what does it even mean)?

Thanks for your help!

Thomas

Robert Lyon's profile picture
Posts: 774

24 March 2020, 16:34

Hi Thomas,

The error that you are seeing is because the server's php.ini file has the open_basedir set to certain paths and Mahara wants to check for some things that exist outside those paths.

If you are not able to add things to the open_basedir paths then to stop the warnings from happening you can edit the file: htdocs/lib/mahara.php

And find and change the following code

// Grab the load average for the last minute
// /proc will only work under some linux configurations
// while uptime is there under MacOSX/Darwin and other unices
- if (is_readable('/proc/loadavg') && $loadavg = @file('/proc/loadavg')) {
+ if (@is_readable('/proc/loadavg') && $loadavg = @file('/proc/loadavg')) {
list($server_load) = explode(' ', $loadavg[0]);
unset($loadavg);
- } else if ( function_exists('is_executable') && is_executable('/usr/bin/uptime') && $loadavg = `/usr/bin/uptime` ) {
+ } else if ( function_exists('is_executable') && @is_executable('/usr/bin/uptime') && $loadavg = `/usr/bin/uptime` ) {
if (preg_match('/load averages?: (\d+[\.,:]\d+)/', $loadavg, $matches)) {
$server_load = $matches[1];
} else {


The '@' before those function calls just suppress the error messages from showing.

Cheers
Robert

16 results