You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
phpvirtualbox is not working when php 8.0.3 and higher is used #264
phpvirtualbox is not working when freebsd 12.2 and php 8.0 and higher is used!
"An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password)."
etc.
Please update internal code to support php 8 please
FreeBSD 13.0 P5 phpvirtualbox and PHP Version 8.0.13 is not working for me.
virtualbox 6.1.28
"An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password)."
Not sure what's wrong. I'm not that familiar with FreeBSD but I installed this virtualbox-ose-nox11 apache24 mod_php80 php80 php80-simplexml php80-soap php80-xml php80-session
and https://github.com/phpvirtualbox/phpvirtualbox/archive/5.2-1.zip
on a fresh FreeBSD 12.2 install and it seems to be working.
When i go to /phpvirtualbox/endpoints/lib
edit language.php
in line 62 and so on
// No lang file found
} else {
$lang = 'en';
@define('VBOXLANG', $lang);
self::$langdata['contexts'] = array();
return;
}
after this , I added manual
$lang = "nl";
so, whatever happened to $lang before, it is now set to "de"
and login is possible again.
to me it proves there is a bug in getting proper en language and popup a working error free login screen.
workaround 2:
I copyd all from nl.xml and past in into en.xml in phpvirtualbox/languages and saved the file with en translated strings again.
Now also the en login works again and i can login to phpvirtualbox.
and the message disappear
"An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password)."
changed the title [-]phpvirtualbox is not working when php 8.0 and higher is used[/-][+]phpvirtualbox is not working when php 8.0.3 and higher is used[/+]on Nov 23, 2021
In endpoints/lib/language.php line 77/78, the issue is that $arrXml is an empty array when english language is selected and therefore doesn't contain key 'context':
Activity
stianvis commentedon Jan 12, 2021
Works fine on CentOS 8.3.2011 and PHP 8.0.1. You have the required packages installed? Web server and PHP installation
Dutchman01 commentedon Jan 13, 2021
FreeBSD 13.0 P5 phpvirtualbox and PHP Version 8.0.13 is not working for me.
virtualbox 6.1.28
"An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password)."
updated to strip long phpinfo
stianvis commentedon Jan 15, 2021
What are your virtualbox and phpvirtualbox versions?
Dutchman01 commentedon Jan 16, 2021
phpvirtualbox-5.2.1 see https://www.freebsd.org/cgi/ports.cgi?query=phpvirtualbox&stype=name&sektion=all
and virtualbox-ose-5.2.44_4 see https://www.freebsd.org/cgi/ports.cgi?query=virtualbox-ose&stype=name&sektion=all
stianvis commentedon Jan 17, 2021
Not sure what's wrong. I'm not that familiar with FreeBSD but I installed this
virtualbox-ose-nox11 apache24 mod_php80 php80 php80-simplexml php80-soap php80-xml php80-sessionand
https://github.com/phpvirtualbox/phpvirtualbox/archive/5.2-1.zipon a fresh FreeBSD 12.2 install and it seems to be working.
Dutchman01 commentedon Nov 23, 2021
What i have found on my setup to make it work!
When i go to /phpvirtualbox/endpoints/lib
edit language.php
in line 62 and so on
after this , I added manual
$lang = "nl";
so, whatever happened to $lang before, it is now set to "de"
and login is possible again.
to me it proves there is a bug in getting proper en language and popup a working error free login screen.
workaround 2:
I copyd all from nl.xml and past in into en.xml in phpvirtualbox/languages and saved the file with en translated strings again.
Now also the en login works again and i can login to phpvirtualbox.
and the message disappear
"An unknown PHP error occurred. This is most likely a syntax error in config.php in phpVirtualBox's folder. The most common errors are an unclosed quote or a missing semicolon in a configuration item that has been entered (e.g. location, username, or password)."
[-]phpvirtualbox is not working when php 8.0 and higher is used[/-][+]phpvirtualbox is not working when php 8.0.3 and higher is used[/+]ms49434 commentedon Nov 23, 2021
In endpoints/lib/language.php line 77/78, the issue is that $arrXml is an empty array when english language is selected and therefore doesn't contain key 'context':
72
73 $xmlObj = simplexml_load_string(@file_get_contents(VBOX_BASE_LANG_DIR.'/'.$lang.'.xml'));
74 $arrXml = $this->objectsIntoArray($xmlObj);
75
76 $lang = array();
77 if(!@$arrXml['context'][0]) $arrXml['context'] = array($arrXml['context']);
78 foreach($arrXml['context'] as $c) {
The fix is simple:
72
73 $xmlObj = simplexml_load_string(@file_get_contents(VBOX_BASE_LANG_DIR.'/'.$lang.'.xml'));
74 $arrXml = $this->objectsIntoArray($xmlObj);
75-
75+ if(!array_key_exists('context',$arrXml)) return;
76 $lang = array();
77 if(!@$arrXml['context'][0]) $arrXml['context'] = array($arrXml['context']);
78 foreach($arrXml['context'] as $c) {
This works with PHP 7 as well.
PR #292 has been created, containing the above code change.
Dutchman01 commentedon Nov 27, 2021
issue closed see #292