Answer the question
In order to leave comments, you need to log in
How to compile files on the server?
Hello!
I was faced with the task of compiling pascal / c ++ sources on a linux server using PHP. In this case, you need to somehow "enter" the data that the program can request. Google didn't turn up anything useful.
There is a system() function that executes an exe file - but I need something a little different. Is it possible to compile the source code and display the result using this function + the fpc compiler? If so, is the compiler suitable for win? And is it possible to "enter" the data?
I would appreciate useful links. Thank you.
Answer the question
In order to leave comments, you need to log in
Win compiler will not work. What data are you going to enter?
Throw the source on the server, and then php.net/manual/ru/function.exec.php specify the correct arguments for the compiler and see the output.
Regarding data entry, in my opinion, a good solution was made in ideone.com
, that is, the user first enters all the data that he will have to enter, and then they are transferred to the program. If you want the user to enter data exactly at the moment when, for example, the program issued an invitation to enter them, then you have to work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question