0

I have written a simple script in ArcGIS environment and I want to run the script through a PHP program.

At present, I am trying this within localhost. In my script, I have defined two parameters. My script is mentioned below.

import arcpy
from arcpy import env
import os
import sys
print("Hellow")
E=sys.argv[1]
E1=sys.argv[2]
arcpy.AddMessage(E+"It is running")
print(E1)

My expectation is to send 2 parameters to this arc script through a web interface. In my PHP programme, I have called the following command to execute my script.

$output = shell_exec("C:\wamp\www\ssh\php_arc\1\test.py '". $_GET['EmployeeID']."' '".$meek1."'");
echo $output;

This is working. But I am just getting the "Hellow"^^ as a result. I am not getting the other results (data given as parameters).

Can anyone help me to make this successful?

  • Try using print command instead of arcpy.AddMessage as this is for ArcGIS Python toolbox output window – user4906240 Feb 26 at 5:38
  • I have done it.but still no results – Shanaka Herath Feb 26 at 5:53
  • 2
    Wouldn't such contravene the license conditions of ArcGIS desktop, as your tag indicates? Or are you using ArcGIS Server Advanced? – Michael Stimson Feb 26 at 6:23
  • at the moment i am using desktop version.if this works ,hope to run the modified script in arcgis server – Shanaka Herath Feb 26 at 6:29
  • 2
    ArcGIS Desktop is for desktop (local) applications, ArcGIS Server is for web applications. ArcGIS Server Advanced has geoprocessing tool services for consumption on a web form. I don't do web but I do vaguely recall that serving from ArcGIS Desktop is a violation of the licensing agreement but that may be dependent on what country you have purchased an ArcGIS license in. – Michael Stimson Feb 26 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.