linux - Run an external program with php -


I have a problem with php! I want to run an external program with php. This program works in the command line and on the Linux platform. So this work should be just fine But I try more time and I can not run it. so what's wrong ! This is a link to the program: and it is fine in the command line and not the case in PHP: Out

and this is php code:

    

I hope to solve this PB. Thanks in advance ..

Update Please upload the executable program and Hopwood.fet file to try it. This is a link:

Try to do this in full path:

  / path / to / install / fet - -inputfile = /path/to/your/Hopwood.fet --outputdir = / path / to / your / out   

so that you can finish execution: < Pre> Exec ("/ path / to / install / fet --inputfile = / path / to / your / hopwood.fet --outputdir = / path / to / your / out"); In addition, make sure that your current process is / path / to / your / out

UPDATE <

  exec ("/ path / to / install / fet --inputfile = / path /     to / your / Hopwood.fet - -outputdir = / path / to / your / out2> /tmp/fet.error.log ", $ output, $ position); Echo "status:" $ position; Echo "Output:" to penetrate ("\ n", $ output); If (file_exists ("/ tmp / fet.error.log")) {echo "error log:". File_get_contents ("/ tmp / fet.error.log"); } @mkotwitha in the second reply (after trying the debug code above)   

UPDATE

was the problem Because fet is trying to use X server. So, adding the solution to @mkotwadi's answer:

  export DISPLAY =: 0   

and the command becomes:

  exec ("Export DISPLAY =: 0 and inputfile = Hopwood.fet --outputdir = out");    

Comments