Mantis - Quercus
Viewing Issue Advanced Details
2067 crash always 10-12-07 17:11 10-18-07 14:57
fororino  
nam  
normal  
closed 3.1.3  
fixed  
none    
none 3.1.4  
0002067: Script time out when usiong Quercus CLI
Following 0001914, I launched a PHP script with command line interface and I got the following error :
$ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
$ C:\Sun\EE5SDK\jdk\bin\jrunscript.exe -cp quercus.jar;resin-util.jar;mail.jar;servlet-api.jar -l ph
p -f test.php
com.caucho.quercus.QuercusRuntimeException: script timed out
        at com.caucho.quercus.env.Env.checkTimeout(Env.java:732)
        at com.caucho.quercus.expr.NewExpr.eval(NewExpr.java:97)
        at com.caucho.quercus.expr.Expr.evalCopy(Expr.java:399)
        at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:86)
        at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
        at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
        at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239)
        at com.caucho.quercus.script.QuercusScriptEngine.eval(QuercusScriptEngine.java:104)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:232)
        at com.sun.tools.script.shell.Main.evaluateReader(Main.java:314)
        at com.sun.tools.script.shell.Main.evaluateStream(Main.java:350)
        at com.sun.tools.script.shell.Main.processSource(Main.java:267)
        at com.sun.tools.script.shell.Main.access0(Main.java:19)
        at com.sun.tools.script.shell.Main.run(Main.java:182)
        at com.sun.tools.script.shell.Main.main(Main.java:30)
Content of test.php
<?php
function parau() {
 echo "O vai 'oe ?\n";
};

echo "Ia ora na\n";
parau();
echo "A parahi";
?>

I tried to write the launcher myself in Java and I got the same result :
package pf.opt.piti.telecom;

import java.io.FileReader;

import javax.script.*;

import com.caucho.quercus.script.*;

public class PHPCLI {

    public static void main(String[] args) {
        try {
            // create a script engine manager
            QuercusScriptEngineFactory factory = new QuercusScriptEngineFactory();

            // create a PHP engine
            ScriptEngine engine = factory.getScriptEngine();

            // evaluate PHP code from String
            FileReader fichier = new FileReader(args[0]);

            engine.eval(fichier);

        } catch (Throwable e) {
            System.out.println("Erreur inconnue");
            e.printStackTrace();
        }
    }
}

Notes
(0002367)
nam   
10-18-07 14:57   
php/214c