Menu

An unknown PHP error occurred

Help
2014-12-24
2018-11-19
  • Karl Stenerud

    Karl Stenerud - 2014-12-24

    I've installed virtualbox, phpvirtualbox, php5-fpm, and nginx. When I
    browse to phpvirtualbox, I get the following:

    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).

    Depending on your PHP configuration, navigating directly toconfig.phpin
    your web browser may display the PHP error message.

    If find that this is not the case, or have no idea what this error
    message means, please raise the issue
    athttp://sourceforge.net/p/phpvirtualbox/discussion/help/

    I can't find any error messages anywhere. Both nginx and php5-fpm report
    no errors, and phpvirtualbox doesn't seem to output any logs.
    If I browse to config.php, it just shows a blank page. Note that I'm
    using the example config.php with no changes.

     
  • Matt Taylor

    Matt Taylor - 2015-03-06

    I am having the same issue except when I navigate to the config.php my entire file shows up?

     
    • Ian Moore

      Ian Moore - 2015-03-06

      PHP is not being parsed by your web server and it is instead just serving the raw PHP source. Please see a how-to on setting up PHP to work correctly in your environment. When navigating to config.php, it should be a blank page.
      From: Matt Taylor electjedidiah@users.sf.net
      To: imoore76@yahoo.com
      Sent: Friday, March 6, 2015 2:36 PM
      Subject: [phpvirtualbox:discussion] An unknown PHP error occurred

      I am having the same issue except when I navigate to the config.php my entire file shows up?An unknown PHP error occurredSent from sourceforge.net because imoore76@yahoo.com is subscribed to https://sourceforge.net/p/phpvirtualbox/discussion/help/To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/phpvirtualbox/admin/discussion/forums. Or, if this is a mailing list, you can unsubscribe from the mailing list.

       
  • Matt Taylor

    Matt Taylor - 2015-03-06

    Awesome I think what I missed was this line

    sudo apt-get install php5 php5-mysql libapache2-mod-php5

    the last lib-mod was not included when I first installed.

    Thanks for the quick response.

    Matt

     
  • Jon The Nice Guy

    Just to note, I'm having a similar issue.

    On Debian 8.1, with Nginx and PHP-FPM, I'm getting no errors logged, so I checked (via this StackOverflow post) that I had all my error log options turned on, and I'm still getting nothing.

    I then realised that actually, adding a phpinfo.php file with the single line "<?php phpinfo();" and calling that wasn't returning anything.... so I re-checked my NGinx config - and it wasn't loading PHP.

    Now, your NGINX is likely to be configured differently to mine, but for the benefit of someone following after me - check your PHP is working before you start to blame phpvirtualbox :)

     
  • AWA van der Sanden

    For me was the solution to enable so php_soap.dll inside php.ini.

    Edit
    nano /etc/php/7.0/apache2/php.ini

    Change
    ;extension=php_soap.dll
    To
    extension=php_soap.dll

     
  • gusdudu

    gusdudu - 2017-11-02

    Hellow from Spain. Any ideas for this error thanks.

    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).

    Depending on your PHP configuration, navigating directly to config.php in your web browser may display the PHP error message.

    If find that this is not the case, or have no idea what this error message means, please raise the issue at http://sourceforge.net/p/phpvirtualbox/discussion/help/

     
  • Jon The Nice Guy

    Hey gusdudu, thanks for getting in touch - I'd never have come looking in this thread otherwise!

    As I mentioned above, it sounds like your web server might not be serving PHP properly. I've not used phpvirtualbox (or, for that matter, written any PHP) for around 2 years now, so I don't know why it's serving up the response it is... but you should probably create a file in the path of your phpvirtualbox directory which has the extension .php and which has the text in it:

    <?php phpinfo();
    

    Browse to that file using your web browser, and confirm it's actually returning something with tables and boxes in it, rather than just that one line!

    If you are getting some kind of properly formatted HTML page back, then you might actually have an issue in your config.php - in which case, run the in-built PHP linting tool (which is to say, it checks for basic syntax errors, and tells you about them) by running:

    php -l config.php
    

    This should be run against the config.php file on the machine which will be hosting phpvirtualbox.

    If that comes back clean, then.... well, I have no idea, but probably worth posting back, and seeing what happens! Good luck!

     
  • Floin Cucu

    Floin Cucu - 2018-03-06

    Hello all. Please advise for the same php error. I have check all the possible fixes on this forum but seems that nothing is helping. I am running Ubuntu 14.04.05, Virtualbox 5.2.8, phpvirtualbox 5.0.5.

    The services are started as vbox user and running ok, there are no errors in config.php, browsing config.php gives blank page.

    Any advice would be appreciated. Thank you.

     
  • Thomas

    Thomas - 2018-03-06

    Hi,

    Did you check your web server log file? Is there any PHP error?

    Can you attach you config.php here, after having blanked vbox's password in the file?

     
    • Floin Cucu

      Floin Cucu - 2018-03-12

      Hi.

      Thank you for opening my eyes. I have checked the Apache's error log that led me to check PHP version and I've found out that I had installed 7.2 over 7.0 but for some reasons the system was bouncing between the two versions. Just downgraded to 7.0 with packages with unneeded packages autoremove and the problem is now solved. Thank you very much again.

       
  • Mike

    Mike - 2018-11-10

    Hi, same error here. After upgrading to Ubuntu 16.04.5 and Virtualbox (5.2?) and PHP7 (reason was it could/should resolve incorrect/out of of sync mouse pointer in console). PhpVirtualbox worked fine before. Spent many days/hours reading many install tutorials and error fixes but finally decided to try my luck here. I'm a linux novice and out of ideas where to look or how to fix it.

    vboxwebsrv is running under the user/password as specified in config.php (although before it was started automatically and now I have to start it manually)

    I inspected all log files shown by webmin and do not see any error messages related to vboxwebsrv or phpvirtualbox.

    Below my config.php. Happy with any clues........

    <?php
    error_reporting(E_ALL);
    
    /**
     * phpVirtualBox example configuration. 
     * @version $Id: config.php-example 585 2015-04-04 11:39:31Z imoore76 $
     *
     * rename to config.php and edit as needed.
     *
     */
    class phpVBoxConfig {
    
    /* Username / Password for system user that runs VirtualBox */
    var $username = 'user';
    var $password = 'password';
    
    /* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
    var $location = 'http://127.0.0.1:18083/';
    
    /* Default language. See languages folder for more language options.
     * Can also be changed in File -> Preferences -> Language in
     * phpVirtualBox.
     */
    var $language = 'en';
    
    /* Set the standard VRDE Port Number / Range, e.g. 1010-1020 or 1027 */
    var $vrdeports = '9000-9100';
    
    /*
     *
     * Not-so-common options / tweaking
     *
     */
    
    // Multiple servers example config. Uncomment (remove /* and */) to use.
    // Add ALL the servers you want to use. Even if you have the server set
    // above. The default server will be the first one in the list.
    /*
    var $servers = array(
            array(
                    'name' => 'London',
                    'username' => 'user',
                    'password' => 'pass',
                    'location' => 'http://192.168.1.1:18083/',
                    'authMaster' => true // Use this server for authentication
            ),
            array(
                    'name' => 'New York',
                    'username' => 'user2',
                    'password' => 'pass2',
                    'location' => 'http://192.168.1.2:18083/'
            ),
    );
    */
    
    // Disable authentication
    #var $noAuth = false;
    
    // Host / ip to use for console connections
    #var $consoleHost = '192.168.1.40';
    
    // Disable "preview" box
    #var $noPreview = false;
    
    // Default preview box update interval in seconds
    #var $previewUpdateInterval = 30;
    
    // Preview box pixel width
    #var $previewWidth = 180;
    
    // Max number of progress operations to keep in list
    var $maxProgressList = 5;
    
    // Change default preview aspect ratio to 1. 
    // http://www.wikipedia.org/wiki/Aspect_ratio_%28image%29#Previous_and_presently_used_aspect_ratios
    #var $previewAspectRatio = 1.6;
    
    // Enable custom VM icons
    #var $enableCustomIcons = true;
    
    /*
    Exclusively use phpVirtualBox's groups configuration rather than VirtualBox groups.
    This has the following effects:
    
    *) Group changes made in phpVirtualBox will not be reflected in VirtualBox programs such as
        VirtualBox and VBoxManage
    *) Group changes will not affect which folder a VM is placed in
    *) You can rename groups that contain running VMs and move / copy running VMs to groups
    */
    #var $phpVboxGroups = true;
    
    /*
    Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
    If this is not set, files are always kept. If this is set, you will be PROMPTED
    to decide whether or not you would like to delete the hard disk file(s) when you
    remove a hard disk from virtual media manager. You may still choose not to delete
    the file when prompted.
    */
    var $deleteOnRemove = true;
    
    /*
     * File / Folder browser settings
     */
    
    // Restrict file types
    var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');
    
    // Restrict locations / folders
    #var $browserRestrictFolders = array('D:\\','C:\\Users\\Ian'); // Or something like array('/home/vbox','/var/ISOs')
    
    // Force use of local, web server based file browser instead of going through vboxwebsrv
    #var $browserLocal = true;
    
    // Disable file / folder browser.
    #var $browserDisable = true;
    
    // Disable Windows drive detection
    #var $noWindowsDriveList = true;
    
    // Just list all drives from C:\ - Z:\ without checking if they exist or not.
    // This may be required on older Windows systems with more than one drive.
    #var $forceWindowsAllDriveList = true;
    
    /*
     * Misc
     */
    
    /*
     * Auto-refresh interval in seconds for VirtualBox host memory usage information.
     * Any value below 3 will be ignored.
     */
    var $hostMemInfoRefreshInterval = 5;
    
    /* Show % of free host memory instead of % used */
    #var $hostMemInfoShowFreePct = true;
    
    /*
     * VM Memory warnings.
     * 
     * If $vmMemoryStartLimitWarn is enabled, each time a VM is started through
     * phpVirtualBox, it will check that the available host memory is greater than
     * the base and video memory of the VM + 50MB (a little bit of overhead). If it
     * is not, a confirmation dialog will be presented to confirm that you want to
     * start the VM.
     *
     * If $vmMemoryOffset is set (and $vmMemoryStartLimitWarn), $vmMemoryOffset
     * megabytes is subtracted from the available host memory before the check is
     * performed by $vmMemoryStartLimitWarn logic. For instance it may be a good
     * idea to always have VM memory requirements + 100MB free. 100 is the default.
     */
    #var $vmMemoryStartLimitWarn = true;
    #var $vmMemoryOffset = 100;
    
    /*
     * Display guest additions version of a running VM on its Details tab
     */
    #var $enableGuestAdditionsVersionDisplay = true;
    
    /* Disable any of phpVirtualBox's main tabs */
    #var $disableTabVMSnapshots = true; // Snapshots tab
    #var $disableTabVMConsole = true; // Console tab
    
    /* Screen resolutions for console tab */
    var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');
    
    /* Console tab keyboard layout. Currently Oracle's RDP client only supports EN and DE. */
    var $consoleKeyboardLayout = 'EN';
    
    /* Max number of network cards per VM. Do not set above VirtualBox's limit (typically 8) or below 1 */
    var $nicMax = 4;
    
    /* Enable advanced configuration items (normally hidden in the VirtualBox GUI)
     * Note that some of these items may not be translated to languages other than English. 
     */
    #var $enableAdvancedConfig = true;
    
    /* Enable startup / shutdown configuration.
     * This only works in linux and you must add the vboxinit file to
     * your startup scripts list.
     */
    #var $startStopConfig = true;
    
    // Authentication library.
    // var $authLib = 'Builtin';
    
    // VM ownership
    #var $enforceVMOwnership = true;
    
    // Per-user VM quota
    #var $vmQuotaPerUser = 2;
    
    // Allow VDE network configuration. This must be supported by the underlying VirtualBox installation!
    // If you do not know what VDE networking is - you do not need it, it is probably not supported by your
    // VirtualBox installation and will cause errors if enabled.
    #var $enableVDE = true; 
    
    // Disable setting SATA controllers port count to the max port number found when saving VMs.
    #var $disableSataPortCount = true;
    
    /* Enable Parallel Port configuration - EXPERIMENTAL
    LPT support may or may not work for you. 
    !!! VirtualBox LPT support only works in Linux. !!!
    */
    #var $enableLPTConfig = true;
    
    /* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" setting
     * in "VBoxInternal/Devices/[controller type]/0/LUN#[x]/Config/IgnoreFlush". See
     * Responding to guest IDE/SATA flush requests at:
     * http://www.virtualbox.org/manual/ch12.html#idp12757424
    */
    #var $enableHDFlushConfig = true;
    
    /*
     * Event listener timeout in seconds. This is an advanced option that most people will
     * probably not need to change.
     */
    #var $eventListenerTimeout = 20;
    
    /* END SETTINGS  */
    
    }
    
     

    Last edit: Mike 2018-11-10
  • Thomas

    Thomas - 2018-11-19

    Hi,

    I am available to answer your questions but please note that this site is no more monitored by phpvirtualbox developers. Please report all issues to Github here: https://github.com/phpvirtualbox/phpvirtualbox/issues

     

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.