Is it possible to use Python with php

I have a VPS Linux web server with php installed. I want to encode some search engines or data mining materials in one application that I am trying to create I'm python.

I want to know that it is possible that I can use python and php together

as a function of calling python in php and vice versa

Like my VPS server, I can install something. Has anyone tried using python in php. Any real time performance issues?

+7
python php
source share
3 answers

You can execute python scripts using exec () function in php script.

Also this seems to give an answer or two to your question.

Python call in PHP

+7
source share

You can watch PiP

To this end, I [the author of the site] wrote a Python extension for PHP. In short, these extensions allow you to interpret the Python interpreter inside PHP (think of PHP as the parent language with Python as its child). This allows you to create and process your own Python objects from PHP. There is also initial support for accessing PHP functions and data from the Python embedded framework.

However, I can not comment on its reliability. You may need to check it out for yourself.

+3
source share

Are you trying to do something like

def helloWorld(): print 'Hello, World' <?php helloWorld(); ?> 

I would say that you certainly cannot.

Edit: Look at php shell_exec though.

0
source share

All Articles