Unable to fetch result of Python Script in PHP
<p>I am using Xampp and Ubuntu 16.04..</p>

<p>now for my project i need python and php integration to call python script from PHP. Actually describing my script... I am using pypi newspaper library to extract a news summary from a news web portal</p>

<pre><code>#!/usr/bin/env python
from newspaper import Article
url='http://www.abplive.in/india-news/countering-terrorism-an-important-shared-objective-by-india-united-states-manohar-parrikar-407134'
article=Article(url)
article.download()
article.parse()
article.nlp()
print article.summary
</code></pre>

<p>So just help me out with a code in php to call a python script</p>

<p>One of the <code>passthru()</code> or <code>exec()</code> commands should do the trick. See <a href="http://php.net/manual/en/function.passthru.php" rel="nofollow">http://php.net/manual/en/function.passthru.php</a> for more info. Something like: </p>

<pre><code>&lt;?php
    $full_path = `&lt;full_path_to_python_script&gt;`;
    passthru($full_path);
?&gt;
</code></pre>

php python