2017-07-02

open_basedir.

Hi, i m tryn to install Yioop on my server, Centos 7 with 32gb ram, with Plesk Onyx Panel, the open_basedir is actually off, but still i m geting this error:
Got error 'PHP message: PHP Warning: file_get_contents(): open_basedir restriction in effect. File(/proc/meminfo) is not within the allowed path(s): (/var/www/vhosts/xxxxxxxxx.net/:/tmp/) in /var/www/vhosts/xxxxxxx/httpdocs/src/configs/Config.php
How can i fix this? Thanks best regards, Robin
Hi, i m tryn to install Yioop on my server, Centos 7 with 32gb ram, with Plesk Onyx Panel, the open_basedir is actually off, but still i m geting this error: Got error 'PHP message: PHP Warning: file_get_contents(): open_basedir restriction in effect. File(/proc/meminfo) is not within the allowed path(s): (/var/www/vhosts/xxxxxxxxx.net/:/tmp/) in /var/www/vhosts/xxxxxxx/httpdocs/src/configs/Config.php How can i fix this? Thanks best regards, Robin

-- open_basedir
What file and line number generated the error?
What file and line number generated the error?

-- open_basedir
Operation not permitted in /var/www/vhosts/xxxxxxxx/httpdocs/src/configs/Config.php on line 542\nPHP message: PHP Notice: Undefined offset: 1 in /var/www/vhosts/xxxxxxxxx/httpdocs/src/configs/Config.php on line 543\n'
p.s thank you for such fast answer sir
(Edited: 2017-07-02)
Operation not permitted in /var/www/vhosts/xxxxxxxx/httpdocs/src/configs/Config.php on line 542\nPHP message: PHP Notice: Undefined offset: 1 in /var/www/vhosts/xxxxxxxxx/httpdocs/src/configs/Config.php on line 543\n' p.s thank you for such fast answer sir

-- open_basedir
Hi Robin,
The code in question is trying to determine how much memory your computer has by looking at /proc/meminfo. However, on your system, this is not allowed. Here is a fix until the next version of Yioop comes out, alter the relevant lines (they should be near line 543) in Config.php to:
     } else if (stristr(PHP_OS, "LINUX")) {
         restore_error_handler();
         $mem_data = @file_get_contents("/proc/meminfo");
         set_error_handler(NS_LIB . "yioop_error_handler");
         if (!empty($mem_data)) {
             $data = preg_split("/\s+/", $mem_data);
             $memory = 1024 * intval($data[1]);
         }
     }
Best,
Chris
(Edited: 2017-07-03)
Hi Robin, The code in question is trying to determine how much memory your computer has by looking at /proc/meminfo. However, on your system, this is not allowed. Here is a fix until the next version of Yioop comes out, alter the relevant lines (they should be near line 543) in Config.php to: } else if (stristr(PHP_OS, "LINUX")) { restore_error_handler(); $mem_data = @file_get_contents("/proc/meminfo"); set_error_handler(NS_LIB . "yioop_error_handler"); if (!empty($mem_data)) { $data = preg_split("/\s+/", $mem_data); $memory = 1024 * intval($data[1]); } } Best, Chris
2017-07-04

-- open_basedir
Thank you sir, still geting this error: Got error 'PHP message: PHP Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in /var/www/vhosts/xxxxx/httpdocs/src/configs/Config.php on line 545\n'
the code part https://pastebin.com/kHy5cHPH
Thank you sir, still geting this error: Got error 'PHP message: PHP Parse error: syntax error, unexpected 'else' (T_ELSE), expecting end of file in /var/www/vhosts/xxxxx/httpdocs/src/configs/Config.php on line 545\n' the code part https://pastebin.com/kHy5cHPH

-- open_basedir
The code snippet you pastbin'd (by the way you can include code directly in the posts by prefixing each line with a space) seemed to have the correct number of parentheses and match what I had in a working config file. I am wondering if maybe there was a stray parenthesis earlier or later? You can drag a copy of your config file into a follow up comment I can locate the error for you and attach it back.
Best,
Chris
The code snippet you pastbin'd (by the way you can include code directly in the posts by prefixing each line with a space) seemed to have the correct number of parentheses and match what I had in a working config file. I am wondering if maybe there was a stray parenthesis earlier or later? You can drag a copy of your config file into a follow up comment I can locate the error for you and attach it back. Best, Chris
2017-07-05

-- open_basedir
((resource:Config.php|Resource Description for Config.php))

-- open_basedir
Hi,
The code you sent didn't have an else statement on line 545. Are you sure it is the same code that was giving the error? I didn't see anything obviously wrong with it. Another thing you can try is to just ditch that whole if-else statement and directly set $memory = to whatever is good for your system.
Best,
Chris
Hi, The code you sent didn't have an else statement on line 545. Are you sure it is the same code that was giving the error? I didn't see anything obviously wrong with it. Another thing you can try is to just ditch that whole if-else statement and directly set $memory = to whatever is good for your system. Best, Chris
X