Page 1 of 1

Error: call to undefined function "var_dump"

PostPosted: July 26th, 2014, 11:25 am
by IvanPanfilov
I try compiling script (Phalanger 3):

<?php
var_dump($_SERVER['argv']);

print 'Hello world!' . PHP_EOL;

by:
phpc /target:exe /root:. /recurse:. /static+ /debug- test.php

i copy PhpNetCore.dll to exe file directory

when execute program test.exe
then i got error

> Error: call to undefined function "var_dump"

same result for print_r($_SERVER['argv']);

> Error: call to undefined function "print_r"

and any other core function such a file_get_contents.

Re: Error: call to undefined function "var_dump"

PostPosted: July 29th, 2014, 3:25 pm
by Jakub Misek
var_dump (and all other PHP functions) is defined in PhpNetClasslibrary.dll, you have to add a reference to this DLL into your .config file (<phpNet><classLibrary><add url="PhpNetClasslibrary.dll" />) or on cmd line /r:PhpNetClasslibrary.dll

Re: Error: call to undefined function "var_dump"

PostPosted: July 30th, 2014, 12:26 pm
by IvanPanfilov
yes, it works finally.

i use this:

phpc /target:exe /root:. /recurse:. /static+ /debug- /r:path-to-dll/PhpNetCore.dll /r:path-to-dll/PhpNetClasslibrary.dll test.php
and still need copy PhpNetCore.dll, PhpNetClasslibrary.dll to exe folder.

Thanks.

Re: Error: call to undefined function "var_dump"

PostPosted: August 6th, 2014, 10:27 am
by Jakub Misek
/r:path-to-dll/PhpNetCore.dll is not needed.

Yes, if you would like to deploy your app without Phalanger installer, you have to bundle it with PhpNetCore.Parsers.dll, PhpNetCore.dll, PhpNetCoreClasslibrary.dll and used extensions (PhpNet*.dll)