how to run python script from php which generates a fileGet the solution ↓↓↓
I'm trying to run python script from php using shell_exec() but it is not working. code is mentioned below
shell_exec() is working for other commands like checking version of python etc.
P.S - init.py is working normally when I run it through cmd.
<?php shell_exec("python C:/wamp64/www/projectx/vc/init.py test123"); ?>
from PIL import Image, ImageDraw, ImageFont import sys image = Image.open('images/background.png') draw = ImageDraw.Draw(image) font = ImageFont.truetype('Times New Roman Gras 700.ttf', size = 100) (x, y) = (150, 100) color = 'rgb(0, 0, 0)' draw.text((x, y), sys.argv, fill = color, font = font) image.save('images/image.png')
People are also looking for solutions of the problem: composer detected issues in your platform: your composer dependencies require a php version ">= 8.0.2".
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.