Re: Embedding Python in PHP and python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- In php-objects@xxxxxxxxxxxxxxx, "Hasanat Kazmi" <hasanatkazmi@...> wrote:
>
> Hello, I want to use python as we use php on web. I want
> url/somefile.py to give me results as some php file will do. How can I
> do it. I tried a number of tutorials online but all went in vain.
>

It might be your apache config.

I know to enable php for execution by Apache, you have to have these lines (at a 
minimum) in your httpd.conf file:

LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml

Python probably requires something similar.

If you are calling python routines from within php... then you should be using the 'system' 
command.  If you are doing something like calling python routines from you FORM 
statement in your html, then it should work... if you have 'told' apache that python 
functions like php (see prior config info above) then it should function properly.

A simple test would be to write a VERY SHORT python routine to generate HTML 'hello 
world'.  Place it in the DOCUMENT_ROOT of your apache server and try executing it.
Check the Apache error log(s) for error messages.

That's just about all I can suggest.

Larr.


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux