X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



3875 Rate this article:
1.3

IDL on the Web with PHP for Windows

IDL on the Web with PHP for Windows

*******************************
Index
1- Setting the Environment
2- Apache Server Configuration
3- IDL and PHP program examples
4- Executing the PHP file
*******************************



1- Setting the Environment

In Windows you will need to configure or set the PATH environment variable so that the following IDL path is included in it:

C:\Program Files\ITT\IDL\IDL81\bin\bin.x86

Please, see the attached file called "Windows Environment Path Variable.PNG" for more details on how to achieve that.



2- Apache Server Configuration

Using the Web Server application called XAMPP, that is available to download from:

http://www.apachefriends.org/en/xampp-windows.html

will allow you to run the Apache Server. Please, install XAMPP and then Start the Apache Module. See attached screen shot "Apache  
Webserver XAMPP.PNG" for more details.



3- IDL and PHP program examples

The example consists of four files. This files are:

index.php
idlweb1.sav
idlweb1.pro
makefile.pro

-------------------------------------------------------------------------------------------------------------------
index.php:
This is the main PHP program. You will need to edit it to be sure that the user variables are pointing to the right places. For  
example, in the section of the index.php file you can find:

/////////////////////////////////
////  USER VARIABLES ////////////
$savfile = "C:\\xampp\\htdocs\\idl\\idlweb1.sav";
$path = "C:\\xampp\\htdocs\\idl";
/////////////////////////////////

As  you can see the Apache server program XAMPP is installed under C:\. Then, under "htdocs\" I have created a folder called "idl".  
Under that folder I copied the "index.php" file plus the "idlweb1.sav" file that will be executed by a called to IDL runtime:

$command = "idlrt.exe $savfile -args $path $fileimg $filetext $npoints";

-------------------------------------------------------------------------------------------------------------------
idlweb1.sav:
The save file that IDL will execute, see line above.

-------------------------------------------------------------------------------------------------------------------
idlweb1.pro:
The actual IDL pro code that produces the plot and the text output.

-------------------------------------------------------------------------------------------------------------------
makefile.pro:
You can run this pro code to produce the save file, but this is not needed.
-------------------------------------------------------------------------------------------------------------------

To set everything up just copy the files:

index.php
idlweb1.sav

into the XAMPP folder:

C:\xampp\htdocs\idl

See screen shot "XAMPP htdocs directory.PNG"



4- Executing the PHP file

Now that everything is in place, you can open a web browser and type:

http://localhost/idl/index.php

You can then select a value for the number of points to be plotted, e.g. 100, and the PHP code will execute IDL and show what you see  
in the screen shot "Example PHP output.PNG".



Notes

Screen shot file names included with this examples are:

Windows Environment Path Variable.PNG
Apache Webserver XAMPP.PNG
Example PHP output.PNG
XAMPP htdocs directory.PNG
Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »