I use Open Server on Windows to raise lokalku. I use this code for the test:

$python = "C:\\Python27\\python.exe"; $cmd = "$python -V"; echo $cmd; echo system($cmd); echo exec($cmd); echo shell_exec($cmd); echo passthru($cmd); 

In the end, none of the options do not display anything. Although if you execute cmd "C: \ Python27 \ python.exe -V", then everything works. What could be the problem

    2 answers 2

    Solved the problem by adding the "start" command:

     $cmd = "start $python -V"; 

      By default, all dangerous functions are disabled in PHP in order to prevent the execution of malicious code and protect the server from unauthorized deployment due to programmer errors that do not always correctly use these functions.

      Remove the disable_functions line from php.ini (php configuration), which lists all the functions that you use, and these commands will be executed.