Skip to main content
Inspiring
August 11, 2009
Question

Application.cfc doesn't run??

  • August 11, 2009
  • 3 replies
  • 1413 views

I did a project for a customer and it worked great on my test site. So I bundled it all up and sent it off to her. She put it on her host and it didn't work. The error said that there was no session variables defined. So she finally let me in to look and make sure everything was as it should be. Sure enough, all the templates were there. I put in a test page just doing a simple setting of a test session variable and then outputting that variable on another page. Didn't work.

Seemed obvious to me. The host didn't have session variables enabled for some reason. Upon contacting them, they told me I had to use cookies to set session variables just like in ASP and PHP. I sent them the adobe docs on session variables and explained how to enable them. Today I get back an email saying "We put in an application.cfm file setting session management to TRUE and now it works" They tried then to explain to me how screwed up I was.

HOWEVER, there is an application.cfc file in there. Very standard one. Sets the session management and timeouts. But for some reason that cfm file is being read but NOT the cfc.

Is it possible to turn off cfcs? At first I said "wow, they must be on CF5 or earlier".  They claim they are on 8. The only thing I can think of is that *.cfc is not set up in IIS. Any other ideas?

This topic has been closed for replies.

3 replies

BKBK
Community Expert
Community Expert
August 11, 2009
The only thing I can think of is that *.cfc is not set up in IIS.

You can test it. Save the following code as TestComponent.cfc.

<cfcomponent output="false">
    <cffunction name="f" returntype="String">
        <cfreturn "It works!">
    </cffunction>
</cfcomponent>

In the same directory, create and run a CFM page containing the line

<cfoutput>#createobject("component","testComponent").f()#</cfoutput>

BKBK
Community Expert
Community Expert
August 11, 2009
Any other ideas?

Coldfusion wouldn't see application.cfc! That must be capital A.

ilssac
Inspiring
August 11, 2009

Good Catch!!!

That is indeed important on unix flavored ColdFusion installs.

You can get by with sloppy naming on windows server where Application.cfc and application.cfc are the same files and either spelling will be called by the CF engine.  But on a unix server these are seperate and distinct files and ONLY the Application.cfc file will be called.

Inspiring
August 12, 2009

Dunno... when the documentation takes such great pains to point out the importance of this issue, and does not discuss "platforms" when doing so, I'll believe them and capitalize that filename.

ilssac
Inspiring
August 11, 2009

<cfdump var="#server#">

Put that in your test file.  It will show exacty what version of ColdFusion you are dealing with.

DinghusAuthor
Inspiring
August 11, 2009

Are you insinuating that they are not being honest about which version they are on? lol

ilssac
Inspiring
August 11, 2009

Or confused... It would not be the first time that I have heard of an ISP right hand that did not know what it's left hand was doing|did|done.