PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, December 30, 2021

[FIXED] Run python script inside php and pass file as a parameter

 December 30, 2021     php, python, yii     No comments   

Issue

I am trying to run a python script inside php file, the problem is i can't pass the file as an argument

something like this

$a ="python /umana/frontend/upload/main.py 'filename' ";

$output =shell_exec($a);

The real problem is, the file is not opening in python script.


Solution

It's solved

$a ="python-path C:/python program path '$file_uploaded_path_as_param' ";

$output =shell_exec($a);

we want to add the python path before python script.



Answered By - Nikhil k gireesh
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing