Answer the question
In order to leave comments, you need to log in
Why is there no error output from the console when executing commands with PHP and how to compile a cpp file?
I check the directory var_dump(system('pwd'));
all the rules, the path outputs
I try to compile in this directory var_dump(system('g++ 1.cpp'));
does not compile + DOES NOT give errors, there is no output string(0) ""
var_dump(system('kgfhkjfvjfk'));
- the same without errors string(0) ""
the same with the
shell_exec
exec
passthru commands
all files of the www-data user and rights 777 are
worth nginx on linux mint
Answer the question
In order to leave comments, you need to log in
Errors are not written to STDOUT, but to STDERR (I personally did not find a way to get STDERR after exec).
As a work-around, you can use this method:exec('blablabla 2>&1');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question