Home >Backend Development >PHP Tutorial >How to build an online code compiler yourself?

How to build an online code compiler yourself?

WBOY
WBOYOriginal
2016-10-11 14:23:432568browse

I want to build an online compiler similar to codepad
that can compile php ruby ​​python and other code blocks online

How to build an online code compiler yourself?

The starting idea is to install a PHP environment in centos and execute php shell_exec("docker run -v "$(pwd)":/usr/src/app -w /usr/src/app docker.io/php php index. php ");

It can be executed normally, but it takes more than 5 seconds, which is not cost-effective. It seems that other online compilers are very fast. How do they achieve it? Is there any master who can share the specific code or ideas

How to build an online code compiler yourself?

Reply content:

I want to build an online compiler similar to codepad
that can compile php ruby ​​python and other code blocks online

How to build an online code compiler yourself?

The starting idea is to install a PHP environment in centos and execute php shell_exec("docker run -v "$(pwd)":/usr/src/app -w /usr/src/app docker.io/php php index. php ");

It can be executed normally, but it takes more than 5 seconds, which is not cost-effective. It seems that other online compilers are very fast. How do they achieve it? Is there any master who can share the specific code or ideas

How to build an online code compiler yourself?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn