The solution to the problem that php cannot execute python: first find and open the php-fpm.conf file; then modify the user and group of php-fpm.conf to root.
The operating environment of this article: Windows7 system, PHP7.1&&python3.5 version, DELL G3 computer
php cannot execute python?
To use php to execute the python command, I found that the command line can output the results normally, but the browser cannot output the results.
After adding 2>&1 after the command and printing the error message, we found that there was a permission error when importing the third-party library.
So I modified the user and group of php-fpm.conf to root and successfully solved it.
Note that php-fpm cannot be run as the root user by default, but it can be run with the -R parameter.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if php cannot execute python?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)
