Hi,
PHP is a scripting language designed for web applications. It isn't really usable outside of the web environment.
It uses reference counting. It can reclaim objects immediately but fails to detect cycles, something which is very useful for web applications. But its missing garbage collector is problematic in a standalone environment.
All PHP libraries have been written with this "restriction" in mind; in fact the "no state" paradigm isn't really a restriction, it is a key feature of PHP.
> php.java.bridge.Request$AbortException
This is a so-called "one-shot continuation", implemented as a special Java exception. It is called when the PHP script has terminated, either explicitly or by its timer.
> What could be the cause of this error?
That's PHP's normal behaviour. If you increase its timeout you will run into the next timeout from the HTTP server. And even if you increase the HTTP server's timeout, the client browser (IE, Firefox) will disconnect after ~30 seconds.
> I am initializing the scripting engine and invocable only
> once, when starting my program.
A PHP script cannot run for more than 30 seconds. However, this isn't a problem because all relevant information is stored in the Java backend. For example:
jrunscript -classpath JavaBridge.jar -l php-interactive
php-interactive> $vec = new java("java.lang.Vector"); $vec->add(1);
php-interactive> echo $vec
[1]
php-interactive> die();
ScriptError: Request$AbortException
php-interactive> echo $vec
[1]
The above example shows that, even though the PHP continuation has been restarted, the script state isn't lost.
Regards,
Jost Boekemeier
|