S
S
Slavik122019-06-06 23:03:19
C++ / C#
Slavik12, 2019-06-06 23:03:19

Building an online compiler?

I want to write my own online compiler for c++. I understand how it works. A person enters his code on the site into the form, after which this code is sent to the server, where the result is compiled and back. How to send a file to the server is clear, but how to make it open there, run and give the result? Where to start, where can I read about it and how can I do it?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
R
riot26, 2019-06-06
@riot26

If you know how to compile from the terminal - exec() . Another question is how you will protect yourself from the execution of malicious code on the server, and you will definitely not be able to do this.

L
longclaps, 2019-06-06
@longclaps

Use a third party compiler and guess

how to make it open there, run and give the result

V
vanyamba-electronics, 2019-06-07
@vanyamba-electronics

You need to write a PHP script that will run compilation on the server using the shell_exec() command .
But of course it would be unsafe to execute arbitrary code on the server. Therefore, compilation and execution should be done in a virtual machine.

V
Vitaly, 2019-06-07
@vt4a2h

For example, here it is: https://github.com/mattgodbolt/compiler-explorer
And the project itself is online: https://godbolt.org/
By the way, most of the professional C++ developers use this tool.

S
Sergey Lerg, 2017-07-08
@Lerg

Apple TV is not exactly omnivorous and omnipotent, but I find it the most interesting.

D
Dmitry, 2019-07-22
@AirJumper

Original Xiaomi Mi TV Box. Classic, nothing more. There are a lot of reviews on the Internet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question