View Full Version : file_get_contents - unknown function

01-19-2010, 05:18 AM
Hi all,

I tried to call following java code to run Quercus from the CLI interface

import com.caucho.quercus.*;
import java.util.*;
import java.io.*;

class callPHP{

public static void main(String[] args) throws IOException {
QuercusEngine engine = new QuercusEngine();
engine.execute("<?php $data = file_get_contents('http://www.google.com'); echo $data; ?>");


After compiling and running the class file, I receive follwoing error on the Windows command line:

Exception in thread "main" com.caucho.quercus.QuercusErrorException: eval::1: Fa
tal Error: 'file_get_contents' is an unknown function.
at com.caucho.quercus.env.Env.error(Env.java:6191)
at com.caucho.quercus.env.Env.error(Env.java:6079)
at com.caucho.quercus.env.Env.error(Env.java:5765)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(Func tionExpr.java:166)
at com.caucho.quercus.expr.FunctionExpr.evalCopy(Func tionExpr.java:151)
at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr .java:86)
at com.caucho.quercus.expr.Expr.evalTop(Expr.java:376 )
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.ja
at com.caucho.quercus.program.QuercusProgram.execute( QuercusProgram.java
at com.caucho.quercus.QuercusEngine.execute(QuercusEn gine.java:139)
at com.caucho.quercus.QuercusEngine.execute(QuercusEn gine.java:100)
at callPHP.main(callPHP.java:13)

Could please help me with this. I'm not sure what I need to do to inculde the file_get_contents function from PHP.


02-21-2010, 05:27 AM
file_get_contents() is part of the standard library that comes included in Quercus. But there was a bug that prevented Quercus from loading its modules. This has been fixed for 4.0.4.

02-21-2010, 10:48 PM
Thanks for the info.

When do you think will 4.0.4 be ready?