Error: call to undefined function "var_dump"

Discussion about the open-source Phalanger [?] project.

Error: call to undefined function "var_dump"

Postby IvanPanfilov » July 26th, 2014, 11:25 am

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.
IvanPanfilov
 
Posts: 10
Joined: July 26th, 2014, 7:05 am

Re: Error: call to undefined function "var_dump"

Postby Jakub Misek » July 29th, 2014, 3:25 pm

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
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Error: call to undefined function "var_dump"

Postby IvanPanfilov » July 30th, 2014, 12:26 pm

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.
IvanPanfilov
 
Posts: 10
Joined: July 26th, 2014, 7:05 am

Re: Error: call to undefined function "var_dump"

Postby Jakub Misek » August 6th, 2014, 10:27 am

/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)
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 124 on September 25th, 2020, 6:57 am

Users browsing this forum: No registered users and 2 guests