Menu

Support for PHP7

Help
VCD
2015-12-08
2016-08-26
  • VCD

    VCD - 2015-12-08

    I am using the release phpvirtualbox-4.3-3 and phpvirtualbox-5.0-4 but found that it couldn't work with PHP7 (I need PHP7 for my new project).

    I tried to trace the code, and found that in file "lib/auth/Builtin.php" (of phpvirtualbox-4.3-3), the "break" statement at line 173 and line 181 have to change to "return". Next, need to installed package php-xml.x86_64 on my CentOS to enable SimpleXML. The login prompt is working afterwards but it still doesn't work after input the username and password with parse error at "lib/ajax.php". I didn't go further as I need to continue my work.

    I am looking forward for phpVirtualBox to include support for PHP7 :)

     

    Last edit: VCD 2015-12-09
  • VCD

    VCD - 2015-12-23

    After further tracing, in file "lib/ajax.php", line 304 should change from:

    $vbox->$vboxRequest['fn']($vboxRequest,array(&$response));
    

    to

    $vbox->{$vboxRequest['fn']}($vboxRequest,array(&$response));
    

    It seems phpVirtualBox is working correct after this change (together with other changes I mentioned in my early post).

    Hope phpVirtualBox can include the change in the next release :)

     
  • Mark Bertolina

    Mark Bertolina - 2016-01-03

    New versions of phpVirtualBox have this code section in /endpoints/api.php instead of lib/ajax.php . VCD's suggestions above ending with adding {}s indeed did fix that line, and was enough to start the web-interface working again.
    My system is:
    Arch
    extra/apache 2.4.18-1
    extra/php 7.0.1-5
    community/phpvirtualbox 5.0_3-1

    You can find php errors, and thus other lines that need to fixed, on a default install as above here:
    /var/log/httpd/error_log

    In my case:
    "
    PHP Fatal error: Uncaught Error: Function name must be a string in /usr/share/webapps/phpvirtualbox/endpoints/api.php:316\nStack trace:\n#0 {main}\n thrown in /usr/share/webapps/phpvirtualbox/endpoints/api.php on line 316
    "

    Which I changed to:

    //$vbox->$request['fn']($request['params'],array(&$response));
    $vbox->{$request['fn']}($request['params'],array(&$response));
    
     
  • Sergej Pupykin

    Sergej Pupykin - 2016-01-03

    Also you need to replace break with return in updateUser function

     
  • Ian Moore

    Ian Moore - 2016-01-08

    Thanks! I'll have this fixed in the next release.

     
  • Ian Moore

    Ian Moore - 2016-01-11

    OK, 5.0-5 (the latest release) supports php 7.

     
  • Mark Bertolina

    Mark Bertolina - 2016-01-30

    Thanks a lot for fixing this so quickly, and phpvirtualbox in general !

     
  • Paul

    Paul - 2016-04-24

    I have same problem in 5.0.5 not working with new ubuntu server 16.04 with php7...
    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).

     

    Last edit: Paul 2016-04-24
  • Kasper Hedegaard

    Hey guys! I found another error, which I cannot decipher - any help would be appreciated!

    [Thu Jun 02 11:21:49.109049 2016] [:error] [pid 2007] [client 192.168.1.133:55739] PHP Fatal error:  Uncaught Error: Call to undefined function simplexml_load_string() in /var/www/html/phpvirtualbox/endpoints/lib/language.php:73\nStack trace:\n#0 /var/www/html/phpvirtualbox/endpoints/language.php(15): __vbox_language->__construct()\n#1 {main}\n  thrown in /var/www/html/phpvirtualbox/endpoints/lib/language.php on line 73, referer: http://192.168.1.103/phpvirtualbox/
    

    Line 73 in the language.php reads this:

    $xmlObj = simplexml_load_string(@file_get_contents(VBOX_BASE_LANG_DIR.'/'.$lang.'.xml'));
    

    BR Kasper

     
  • Kasper Hedegaard

    Fix for above mentioned error was:

    sudo apt-get install php-xml

    Restart the servers and everything was working :)

    Found the answer in another forum question! Have a nice day! WUHUU!

     
  • mstudio

    mstudio - 2016-06-02

    phpvirtualbox doesn't work with the last PHP update. Please fix it. Thanks

     
  • Ronny Ager-Wick

    Ronny Ager-Wick - 2016-08-23

    In order to get phpVirtualBox 5.0.5 to work on Ubuntu 16.04 you need to do the following:
    sudo apt-get install php-xml php-soap
    sudo service apache2 restart # or similar for nginx or whtever other webserver you use

     
  • Andrés Sánchez

    doesn't work in php7. Any another ideas.

    Ubuntu server+php7+phpvirtualbox5.05

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.