Putting fet file into FET program by the terminal

Started by Hema, March 24, 2011, 11:27:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hema

Hi every one,
I've .Fet file I need to put (running) it into FET program by the PHP, How I can do it? I using SUSE 11.2!!
Other question how I can running FET by the terminal?

I need your help, thanks  ::)

Liviu Lalescu

Quote
Other question how I can running FET by the terminal?

I can only answer this question, which is easy for me. Open konsole, cd to the fet executable directory and type ./fet

Hema

Thanks for your help, that is great :) but how I can put it into php code OR How I can run Fet by PHP code?
[size=9]xxxx@linux-jlb7:~/fet-5.14.2> ./fet --inputfile=Hopwood.fet[/size]

Liviu Lalescu

#3
Maybe you could search the Internet for running executables by PHP or javascript. If you find the answer to your question, please let us know in this thread.

I would suggest you to upgrade your FET to the latest version, it is not difficult.

Hema

These days, I trying to read about exec and other PHP functions, Inshallah I'll tell you if everything is OK.
Thanks for your help and for FET's update :)

Hema

#5
Assalam,

Alhamdulillah  :)  the problem is solved with exec(), and fet is running in the php background correctly :), AND I have seen instructors' tables which were produced.....

Must to be do:
1- After compile  FET command line version.
2- putting your program fet, input file such as: Hopwood.fet and your php code under /srv/www/htdocs/

The PHP code:

<?php

'xhost +local:apache';  //Give permission for apache to use x server

if (exec("export DISPLAY=:0  && ./fet --inputfile=Hopwood.fet
--outputdir=hema 2> /tmp/error.log"
) )
&
#123;
//exec("export DISPLAY=:0  && ./fet --inputfile=Hopwood.fet
--outputdir=hema 2> /tmp/error.log");
   echo "
done" ;
&#125;
?>


4- after that open your browser and write localhost/php_file.php, then you can see your outputs :)

exec (): Execute an external program
'xhost +local:apache' and DISPLAY=:0 to give permission for apache to use x server.

PS: you can do this command in terminal for give xserver permission  xhost +local:apache.

Mahioo,helped me a lot ::)

Good luck!