Page 1 of 1

[SOLVED]using php to run a external application

Posted: Thu Nov 09, 2006 1:27 am
by ryuuka
back again

this time i want the app i've been working on all this time to open
a external application(not a webapp, real one like vncviewer)
but the way i've tried it, just linking will open a download as i knew it
probably would.

do you have any pointers on where to look for more information on this?
Or small samples of code or a site wich has a tutorial of some kind.

security is not an issue it's only accesible to the admins on this network.
believe me i've tried.

thanks in advance

Posted: Thu Nov 09, 2006 1:33 am
by Luke
stab in the dark... http://us3.php.net/exec ? I'm not sure though

Posted: Thu Nov 09, 2006 2:07 am
by dibyendrah
Go to this thread for more information:
viewtopic.php?t=57961

Dibyendra

Posted: Thu Nov 09, 2006 2:16 am
by ryuuka
k got the function etc
i've tried my fair bit of these commands but i keep getting this error:
Warning: exec() [function.exec]: Unable to fork [vncviewer.exe] in D:\wwwroot\gispen.net\gispen\exec.php on line 5
been reading up on this error and it's being suggested that it's a security issue.
And because the php.ini i located in the windows dir of one of the servers i don't
have access to it. Can you give me any hints on how to approach this problem.

is it a security problem or something else?
this is my code

Code: Select all

<?php
error_reporting(E_ALL); 
ini_set('display_errors', TRUE);

echo exec('vncviewer.exe');

?>
ps. this is the complete page acording to php.net this should work

Posted: Thu Nov 09, 2006 3:30 am
by dibyendrah
exec(), passthru(), system(), shell_exec() etc depends on the php environment. They are disabled on safe mode.If it's not in safe mode and you're getting errors, the path to the binary may not be correct. Is 'vncviewer.exe' lies on same directory where you are executing the script ? Try giving the absoulute path or relative path of the binary where it is installed.

Posted: Thu Nov 09, 2006 4:20 am
by ryuuka
thanks it works now

needed to add a path (/app/vncviewer)
can't believe i overlooked that :(