Help PHP shell_exec fails to start a photoshop droplet

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MrMarsh
Forum Newbie
Posts: 3
Joined: Wed Feb 06, 2008 3:55 am

Help PHP shell_exec fails to start a photoshop droplet

Post by MrMarsh »

I have been trying to have php script invoke an .exe file generated by photoshop .

For the purposes of testing I have simplified the real life scenario to as simple a level as I can , with no parameters needing to be passed

I have created a test droplet test.exe that I have tested and works fine
for testing I have also created a test.bat file I know correctly invokes the droplet test.exe and a directory listing
All files in same directory as the php script, and has a DIR command in it

I am calling a command string as follows:-

$testshell = shell_exec($shellcmd);

Results are as follows:

$shellcmd = "Dir" -- as expected I get a listing returned
$shellcmd = "test.exe" --- no response
$shellcmd = test.bat --- all lines of the .bat files are echooed and the DIR command returns list infomation.

I can see no error in the php error log , although the bat files was clearly executed it just looks like the photoshop exe is just not run or generates an no visible to php.

any help gratefull recieved.

Thanks

Dan
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Help PHP shell_exec fails to start a photoshop droplet

Post by Kieran Huggins »

usually droplets generate / modify images, but don't return anything per se. Does it generate a file somewhere?

try it on the command line, does it do anything there?
MrMarsh
Forum Newbie
Posts: 3
Joined: Wed Feb 06, 2008 3:55 am

Re: Help PHP shell_exec fails to start a photoshop droplet

Post by MrMarsh »

Thanks for the suggestion, The test droplet writes an image to a known location when run outside PHP this works . I tried running the php invokation both with PS already running, and needing to be started.

The batch process invokation fires up photoshop - but again the php call results in no activity not even launching PS

A bit more info:

This is on Windows XP with Apache 2.2 I did womder if there was a security setting in Apache to stop exe's bing invoked in this way. My application is actually quite safe, as the webserver is implementing automated workflow process on an intranet with no public access or useage.

Thanks
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Help PHP shell_exec fails to start a photoshop droplet

Post by Kieran Huggins »

the only other thing I can think to suggest is to try using full paths... maybe it's a bizarre user home directory thing?
MrMarsh
Forum Newbie
Posts: 3
Joined: Wed Feb 06, 2008 3:55 am

Re: Help PHP shell_exec fails to start a photoshop droplet

Post by MrMarsh »

I made a little more progress sorting out (and simplifying the path and locations of the file. I eventually did see some errors in the Appache log complaining of invalid syntax, with some and other suggestions and once getting the path variables correct I tried running up calc.exe this fails and in fact just like the photoshop droplet the script hangs for 30-60 sec before returning.

I am really stuck now - looks to me like an ability of appache to run external exes

Any futher suggestions?

PS i did note that i have been seeing DCOM error event 10010 coincident with the scrpt eventually returning

Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10010
Date: 07/02/2008
Time: 16:16:31
User: NT AUTHORITY\SYSTEM
Computer: FULFILMENT-UK
Description:
The server {6DECC242-87EF-11CF-86B4-444553540000} did not register with DCOM within the required timeout.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Post Reply