Do you need any permission for PHP to call python script under windows?

Why when PHP calls the Python script, it is possible for the script to execute some simple output
for example:

p.py
print(123);

:

from os import startfile  -sharp
path = "D:\Wildlife.wmv"
startfile(path)

:
p=os.popen("rv D:\a.AVI"); //RV


CMDPythonPHP

php:
shell_exec("python D:\pytest\play.py")

:exec("python D:\pytest\play.py",$out,$status)
$status 0 
May.08,2022

try using the full python interpreter path instead of python


should be the execution directory (the reason for the working directory). When PHP is called, it becomes the directory of the current PHP. So change the working directory, or set the path of the file opened by py to an absolute path.

< H1 > change the work path < / H1 >

import os
os.chdir

< H1 > View the path to the py execution file < / H1 >

import sys
print (sys.argv [0])

< H1 > View current work path < / H1 >

import os
print (os.getcwd ())

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e47464-431d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e47464-431d0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?