tags:

views:

225

answers:

2

I am trying to minify some files in a roll-up script using jsmin. This works just fine on my local machine but when pushed to production it doesn't work at all. I am running the built-in CF development server locally and IIS on production. Not really sure how I should go about debugging this. Here is a relevant code snippet:

    <cfset LOCAL.args = '/c "C:\Inetpub\wwwroot\jsmin.exe < #LOCAL.jsfile#"'>
    <cfexecute name="c:\windows\system32\cmd.exe"
               arguments="#LOCAL.args#"
            timeout=10
         variable="LOCAL.jsmin">    
    </cfexecute>
+1  A: 

As Henry says, first thing to check is permissions.

What user is the CF service running as? Does that user have permission to access both cmd.exe and jsmin.exe ?

etc

Peter Boughton
Both the IUSR and SYSTEM have read and execute permissions to the file. I am assuming JRun.exe is the web server and it is being run under SYSTEM. I checked in the website settings and the application has execute permissions set to "Scripts and Executables."
illvm
Goto Control Panel > Admin > Services, find ColdFusion, right-click>Properties, goto Log on tab. - **that** is the user it's running as and which needs *Windows* level execute permissions, not IIS level permissions.
Peter Boughton
It's set to Local System account.
illvm
+2  A: 

I think the issue was with trying to run a 32-bit executable under a 64-bit OS, but I am not entirely sure. I couldn't get a good C compiler on my machine so I ended up getting the Java source for JSMin and running it using ColdFusion's JRE. That made it work.

illvm