Re: PHP package issues

  • From: Antti Kantee <pooka@xxxxxx>
  • To: rumpkernel-users@xxxxxxxxxxxxx
  • Date: Mon, 13 Jul 2015 00:46:14 +0000

On 13/07/15 00:00, Brian G. wrote:

Hey everyone, I'm trying to get up and running with rumprun-packages/php
and I've hit a bit of a roadblock.

I'm able to launch the demo site provided in standalone mode, however, when
I try to load in a larger PHP application (uses namespace, calls to
__FILE__ and other language features) I receive parse errors.

When running the application on a traditional system I do not encounter any
issues like this, even when trying to recreate configuration conditions.

Just guessing, but do you have e.g. AnnotationRegistry available on your host system, but not present in the rumprun guest? If not, should you somehow attempt to include it under /data (or wherever) on the guest?

In the code there is one file that looks like this:


<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

/**
* @var ClassLoader $loader
*/
$loader = require __DIR__.'/../vendor/autoload.php';

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

return $loader;


This file has no linting errors, but when I browse to it, I receive this
error:

*Parse error*: syntax error, unexpected '::registerLoader(a' in
*/data/www/symfony_demo/vendor/autoload.php* on line *10*

An error like that makes me believe that "AnnotationRegistry" is not recognized as an identifier, and backtracking makes me believe that "use Doctrine\...\AnnotationRegistry" fails.

Other related posts: