comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL with php
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL with php [message #52252] Thu, 25 January 2007 10:55 Go to next message
JD Smith is currently offline  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 Go to previous messageGo to next message
pranavkesarkar@gmail. is currently offline  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 #52286 is a reply to message #52254] Tue, 23 January 2007 02:43 Go to previous messageGo to next message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
What if you compile your program into a .sav file and call it with idl
-rt ? I haven't tried it myself, but I'd certainly like to know if it's
possible.

The alternative is to use IDL ION and pay another hefty licence fee.
I've done it this way: it's relatively simple.

regards,
Greg


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
Re: IDL with php [message #52287 is a reply to message #52286] Tue, 23 January 2007 02:38 Go to previous messageGo to next message
Ben Panter is currently offline  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 Go to previous message
Nigel Wade is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Cutting/Exclude ROI's based on overlapping
Next Topic: Write image to CDF file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:11:16 PDT 2025

Total time taken to generate the page: 0.00627 seconds