Re: IDL with php [message #52252] |
Thu, 25 January 2007 10:55  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Thu, 25 Jan 2007 08:51:47 -0800, pranavkesarkar@gmail.com wrote:
> I can compile and run the file on the command line but I cannot figure out
> a way to run the program using php. I am working on php and have been
> trying to use the php shell commands to execute the .pro file but it
> doesnt seem to work.
> Thanks for the help.
You probably want to use proc_open or popen to communicate with IDL
directly. Here's an example I found interfacing to GNUPlot:
http://celeste.cn/PHP-GNUPlot/
The issue will be starting and restarting IDL continuously for each
request, which, if they are frequent, will be painful.
JD
|
|
|
Re: IDL with php [message #52254 is a reply to message #52252] |
Thu, 25 January 2007 08:51   |
pranavkesarkar@gmail.
Messages: 2 Registered: January 2007
|
Junior Member |
|
|
I can compile and run the file on the command line but I cannot figure
out a way to run the program using php. I am working on php and have
been trying to use the php shell commands to execute the .pro file but
it doesnt seem to work.
Thanks for the help.
On Jan 23, 5:38 am, Ben Panter <m...@privacy.net> wrote:
> pranavkesar...@gmail.com wrote:
>> Hello,
>
>> I am working on a website and I use php to connect to the database. The
>> database contains some data that I plot using IDL,I use linux operating
>> system and apache as a service,now I was thinking of a way by which I
>> can use php shell commands(system,exec,shell_exec) to execute a .pro
>> file.If any of you can help me out I would highly appreciate it.
>> Thank You
>
>> Pranav D KesarkarHi Pranav,
>
> I think you might want something called a batch file. This is a file
> containing a series of commands rather than a typical idl program which
> starts with PRO or FUNCTION. You can call this from the shell with the
> following:
>
> idl batch.pro
>
> The batch file can compile and run normal IDL programs... suitable
> contents for batch.pro could be
>
> .r myprog.pro
> myprog
>
> and make myprog.pro a standard idl program (or function)
>
> cheers,
>
> Ben
>
> --
> Ben Panter, Edinburgh, UK.
> Email false,http://www.benpanter.co.uk
> or you could try ben at ^^^^^^^^^^^^^^^
|
|
|
|
Re: IDL with php [message #52287 is a reply to message #52286] |
Tue, 23 January 2007 02:38   |
Ben Panter
Messages: 102 Registered: July 2003
|
Senior Member |
|
|
pranavkesarkar@gmail.com wrote:
> Hello,
>
> I am working on a website and I use php to connect to the database. The
> database contains some data that I plot using IDL,I use linux operating
> system and apache as a service,now I was thinking of a way by which I
> can use php shell commands(system,exec,shell_exec) to execute a .pro
> file.If any of you can help me out I would highly appreciate it.
> Thank You
>
> Pranav D Kesarkar
>
Hi Pranav,
I think you might want something called a batch file. This is a file
containing a series of commands rather than a typical idl program which
starts with PRO or FUNCTION. You can call this from the shell with the
following:
idl batch.pro
The batch file can compile and run normal IDL programs... suitable
contents for batch.pro could be
.r myprog.pro
myprog
and make myprog.pro a standard idl program (or function)
cheers,
Ben
--
Ben Panter, Edinburgh, UK.
Email false, http://www.benpanter.co.uk
or you could try ben at ^^^^^^^^^^^^^^^
|
|
|
Re: IDL with php [message #52330 is a reply to message #52254] |
Fri, 26 January 2007 01:44  |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
pranavkesarkar@gmail.com wrote:
> I can compile and run the file on the command line but I cannot figure
> out a way to run the program using php. I am working on php and have
> been trying to use the php shell commands to execute the .pro file but
> it doesnt seem to work.
> Thanks for the help.
>
In PHP the statement we use to execute an IDL script (the name of which is held
in $idl_input) is:
system("idl < ".$idl_input." 2>&1",$return);
or
exec("idl < ".$idl_input." 2>&1",$output,$return);
--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
|
|
|