Page 1 of 1
[OS Shell] how to run python compiler from php
Posted: Fri Apr 23, 2010 4:28 am
by elnaz1010
the title is self expeditionary,
how to run python compiler from php?
something like:
echo passthru('python test.py') won't to the job.
i tested it with exec or shell_exec or system, but still i get no result, just a null output.
Re: [OS Shell] how to run python compiler from php
Posted: Fri Apr 23, 2010 2:35 pm
by Christopher
Is it actually running python? You may need absolute paths? When you say not output, are you getting a result array and error code back from exec() ?
Re: [OS Shell] how to run python compiler from php
Posted: Fri Apr 23, 2010 9:06 pm
by elnaz1010
yes it build a process in host OS and will execute test.py
there is no need to have absolute path, if python is installed, it is in path, so that you can call it anywhere. test.py is beside php script, so that there is no need to have absolute path. and no i get a null value with exec without any error code in it
all i want to do is to run a process in my host, so that it can do some automatic job with out user request. so again, how i can access my python compiler from php and get some output?
and by the way i want my scripts to be runnable in as much as hosts as possible, am i should go for pure c or c++ and then compile it? or using python is fine and most hosts have them?
also tell me if perl compiler is more available in hosts than python.
thanks alot
regards, elnaz