0
Running the example of documentation on the site works.
Examples:
echo exec('whoami'); $output = shell_exec('ls -l'); echo "<pre>$output</pre>";
My code does not differ so much from the examples described in the documentation, what I want to do is just run another application with the following command:
My code/example:
> $comando = "python3 caminho/arquivo.py"; > exec($comando);
And now folks!?
Do you want to run a Python or PHP file? Or do you have a PHP application that runs a Python file?
– J. Pedro A.
Yes, I have an application running in PHP that will run a python file. To be more exact the application will give the command execution in the terminal to run a python script. Which in my case the command is: python3 path/file.py
– Gustavo Costa
What’s the problem? I couldn’t understand it very well. What would be "not working properly?". If there is an error message or some unexpected behavior, edit your question and add more information
– Wallace Maxters
does not work correctly refers to the point of which for commands like: ls, mkdir, pwd. It works, but "python3 path/file.py" is a command just like any other and it doesn’t run/work.
– Gustavo Costa
check the permission in the directory and in the file you want php to run
– Alessandro Schneider