PDA

View Full Version : Quercus and Symfony2


subsven
08-29-2011, 08:39 PM
Hi,

I'm trying to run the Symfony2 Standard Edition (see http://symfony.com/download) under Quercus using Resin 4.0.20, but I'm getting some errors (when calling web/app_dev.php)


$foo = new static(); is allowed in PHP 5.3 (late static binding), but Quercus stops with the error message 'static' is an unexpected token, expected an expression.
spl_autoload_register() allows three parameters in PHP 5.3, but spl_autoload_register(array($this, 'loadClass'), true, $prepend); leads to the error message Warning: function 'spl_autoload_register' called with 3 arguments, but only expects 1 arguments
When using namespaced classes, some standard namespace-less classes like Exception have to be references with a leading backslash (to distinguish between a namespace-less class and a class with the same name in the current namespace), however public function handle(\Exception $exception) leads to the error message namespace identifier is not allowed at '\Exception' in ...


Are these known errors of Quercus/Resin 4.0.20?

I tried to work around the "new static()" errors by using "new self()" or "new CLASSNAME()" (which isn't of course the same in all cases) and calling spl_autoload_register() with just one parameter, but changing from function ...(\Exception ...) to function ...(Exception ...) gave me the following backtrace:

500 Servlet Exception


[show] com.caucho.quercus.env.QuercusLanguageException: ObjectExtValue@2082867241[ErrorException]

com.caucho.quercus.env.QuercusLanguageException: ObjectExtValue@2082867241[ErrorException]
at com.caucho.quercus.env.Value.toException(Value.jav a:845)
at com.caucho.quercus.statement.ThrowStatement.execut e(ThrowStatement.java:59)
at com.caucho.quercus.statement.IfStatement.execute(I fStatement.java:84)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.Function.callImpl(Funct ion.java:433)
at com.caucho.quercus.program.Function.callMethod(Fun ction.java:469)
at com.caucho.quercus.function.AbstractFunction.callM ethod(AbstractFunction.java:710)
at com.caucho.quercus.env.ObjectExtValue.callMethod(O bjectExtValue.java:883)
at com.caucho.quercus.env.CallbackObjectMethod.call(C allbackObjectMethod.java:131)
at com.caucho.quercus.env.Env.error(Env.java:6454)
at com.caucho.quercus.env.Env.error(Env.java:6407)
at com.caucho.quercus.env.Env.error(Env.java:6055)
at com.caucho.quercus.env.Env.uncaughtExceptionError( Env.java:3923)
at com.caucho.quercus.env.Env.executeTop(Env.java:390 5)
at com.caucho.quercus.servlet.QuercusServletImpl.serv ice(QuercusServletImpl.java:189)
at com.caucho.quercus.servlet.QuercusServlet.service( QuercusServlet.java:594)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:96)
at com.caucho.server.dispatch.ServletFilterChain.doFi lter(ServletFilterChain.java:109)
at com.caucho.server.webapp.WebAppFilterChain.doFilte r(WebAppFilterChain.java:156)
at com.caucho.server.webapp.AccessLogFilterChain.doFi lter(AccessLogFilterChain.java:95)
at com.caucho.server.dispatch.ServletInvocation.servi ce(ServletInvocation.java:287)
at com.caucho.server.http.HttpRequest.handleRequest(H ttpRequest.java:811)
at com.caucho.network.listen.TcpSocketLink.dispatchRe quest(TcpSocketLink.java:1186)
at com.caucho.network.listen.TcpSocketLink.handleRequ est(TcpSocketLink.java:1148)
at com.caucho.network.listen.TcpSocketLink.handleRequ estsImpl(TcpSocketLink.java:1132)
at com.caucho.network.listen.TcpSocketLink.handleRequ ests(TcpSocketLink.java:1055)
at com.caucho.network.listen.TcpSocketLink.handleAcce ptTask(TcpSocketLink.java:903)
at com.caucho.network.listen.AcceptTask.doTask(Accept Task.java:74)
at com.caucho.network.listen.ConnectionTask.runThread (ConnectionTask.java:97)
at com.caucho.network.listen.ConnectionTask.run(Conne ctionTask.java:80)
at com.caucho.network.listen.AcceptTask.run(AcceptTas k.java:59)
at com.caucho.env.thread.ResinThread.runTasks(ResinTh read.java:164)
at com.caucho.env.thread.ResinThread.run(ResinThread. java:130)

Resin/4.0.20 Server: 'default'

All kinds of tips and tricks are greatly appreciated! :-)

Regards,

Sven

puentesdiaz
08-27-2012, 03:02 PM
the people of caucho, must see this... Symfony 2 is the basis fo DRUPAL 8

nam
08-27-2012, 07:58 PM
Hi,

The "new static()" problem was fixed for 4.0.30. We're in the process of going through Symfony and fixing issues as we encounter them.

puentesdiaz
08-28-2012, 07:50 PM
hi nam... these is a great new...

remember that symfony2.1 need PHP 5.3.3
and symfony 2.0.x need PHP 5.3.2

source: https://github.com/symfony/symfony/blob/master/README.md

Requirements

Symfony2 is only supported on PHP 5.3.3 and up.

Be warned that PHP versions before 5.3.8 are known to be buggy and might not work for you:

before PHP 5.3.4, if you get "Notice: Trying to get property of non-object", you've hit a known PHP bug (see https://bugs.php.net/bug.php?id=52083 and https://bugs.php.net/bug.php?id=50027);

before PHP 5.3.8, if you get an error involving annotations, you've hit a known PHP bug (see https://bugs.php.net/bug.php?id=55156).



i'm develop a application over symfony 2.1, if you want test new release of resin for PHP5.3.3, i can do it....

cheers

puentesdiaz
08-28-2012, 08:01 PM
the check file say:






/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:31: Warning: can't find class CallbackObjectMethod[Symfony\Component\ClassLoader\UniversalClassLoader [Symfony\Component\ClassLoader\spl_autoload_unregis ter]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:31: Warning: Callable: 'CallbackObjectMethod[Symfony\Component\ClassLoader\UniversalClassLoader ::loadClass]' is not a valid callable argument [Symfony\Component\ClassLoader\spl_autoload_unregis ter]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:31: Warning: can't find class CallbackObjectMethod[Swift [Symfony\Component\ClassLoader\spl_autoload_unregis ter]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:31: Warning: Callable: 'CallbackObjectMethod[Swift::autoload]' is not a valid callable argument [Symfony\Component\ClassLoader\spl_autoload_unregis ter]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:45: Warning: can't find class CallbackObjectMethod[Symfony\Component\ClassLoader\UniversalClassLoader [Symfony\Component\ClassLoader\spl_autoload_registe r]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:45: Warning: Callable: 'CallbackObjectMethod[Symfony\Component\ClassLoader\UniversalClassLoader ::loadClass]' is not a valid callable argument [Symfony\Component\ClassLoader\spl_autoload_registe r]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:45: Warning: can't find class CallbackObjectMethod[Swift [Symfony\Component\ClassLoader\spl_autoload_registe r]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php:45: Warning: Callable: 'CallbackObjectMethod[Swift::autoload]' is not a valid callable argument [Symfony\Component\ClassLoader\spl_autoload_registe r]

/home/rober/Descargas/resin-4.0.30/webapps/ROOT/2-0-17/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php:44: Fatal Error: 'Symfony\Component\HttpKernel\Debug\static' is an unknown class name.