Softaculous


Topic : Python on AMPPS


Posted By: patatex on May 14, 2016, 2:18 pm
Hi everybody,

AMPPS is well working on my mac (El Capitan), I would like to execute Python scripts, but I don't know what I have to do and what files should I modify?
Is there someone who could explains me, step by step, the best way to achieve my goal.
I Tried to follow what is written in a post ( dated 2012) on this forum, but it doesn't work.
Do I  need to create a wsgi-scripts folder, or cgi-bin is enough ? Should I modify python.conf and / or http.conf ? And If so, may you show me correct files.
I thank you, to give me any reply.
Pat.

Posted By: lysakowski on November 23, 2017, 4:18 am | Post: 1
How come nobody from Softaculous ever responds to these threads?  Does that require payment?  What's going on with technical support? 

Is the user community so small that noone reads these posts for assistance? 

:-(

Posted By: Rishi_P on December 4, 2017, 7:49 am | Post: 2
Hi,

You can run python script from cgi-bin folder, use following steps:

Go to /path/to/Ampps/www/cgi-bin folder.

Create one test.py file and copy following code in it. In first line put actual path to your Ampps folder.

Quote

#!/path/to/Ampps/python/bin/python
print ("Content-type: text/plainnn")
print ("Hello world")


Save it, restart Apache.

Now access your file on browser with following url:

localhost/cgi-bin/test.py

You can also call your .py file in .php and execute that.

create one test.php in /Ampps/www folder and enter following code in it.

Quote

<?php
$data=  exec('python C:Amppswwwcgi-bintest.py');
echo "File Contain " .  $data;
?>


Now run above file on browser, localhost/test.php


Powered By AEF 1.0.8 © 2007-2008 Electron Inc.