Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2009 (Minneapolis, MN) with: Ryan Vikander and Kashif Khan

Ask Ben: Checking The ColdFusion Version

By Ben Nadel on

I don't have access to our server's cold fusion administrator. How can I tell what version of cold fusion we are running?

Checking your ColdFusion version could not be easier. All you have to do is dump out the SERVER scope. The version of ColdFusion is contained in a field titled "ColdFusion.ProductVersion." You should see a number like 7,0,1,116466. Additionally, the type license type of the system (ex. enterprise, developer, etc.) is in a field titled "ColdFusion.ProductLevel."

  • <!--- Dump out the server scope. --->
  • <cfdump var="#SERVER#" />
  •  
  • <!--- Store the ColdFusion version. --->
  • <cfset strVersion = SERVER.ColdFusion.ProductVersion />
  •  
  • <!--- Store the ColdFusion level. --->
  • <cfset strLevel = SERVER.ColdFusion.ProductLevel />
Tweet This Deep thoughts by @BenNadel - Ask Ben: Checking The ColdFusion Version Thanks my man — you rock the party that rocks the body!


Reader Comments

As a newbie, I am finding myself unable to connect to my ColdFusion 8 server and came across your valued information.

Could you kindly help me understand WHERE to put this code snippet?

Thanks in advance.

@Jeannie,

You can put this code on any page. However, if you cannot connect to your ColdFusion server, you cannot run the above ColdFusion code.

OK that is the heart of my problem. My ColdFusion runs beautifully on my XP, but I cannot get it to run on my Vista laptop.

Could you kindly direct me to help? I have googled and sought to fix this since June 6. I would be most grateful for assistance.

Kind regards,

Jeannie

Thanks Ben! You saved me from having a heart attack. I thought a client's host was running CF 6 until I dumped the server scope ... whew, that was almost really bad ;)

Will ColdFusion Server Enterprise 6,1,0,63958 version supports style attribute for cfchart?

I'm getting "Attribute validation error for tag chart." error

Thanks Ben, Very informative article man.

But what if we want use Server Scoped Variables as pseudo-constructor in Application.cfc or Application.cfm?
In this case where we need to define Server Scoped Variables?

@Sanoop,

In ColdFusion 9, you can now specify a ColdFusion component that defines an onServerStart() event handler. You can then, in the ColdFusion admin, point to this CFC to be used when the server initializes.

However, if you don't want to go that route, you can definitely use server-scoped variables within the Application.cfc pseudo-constructors; however, you just have to be careful that you don't reference a value before it's defined. You can define those in the Application.cfc if you want.

I don't typically store anything in the server scope so I don't have great advice on this matter.

In our code base we have our own arrayFind() and arrayFindNoCase() for use on older version of CF.

Do you know if it is possible to conditionally declare/include these functions based on this version technique you've shown here?

I tried wrapping a cfscript block in a cfif but i don't think that works.

@Howie,

While you can't wrap an entire CFFunction tag in conditionals, you can certainly wrap a CFInclude tag in conditionals.

  • <cfif (... NOT CF9 ...)>
  • <cfinclude template="my_array_fn.cfm" />
  • </cfif>

Or, you could always define them with some less-than-intuitive naming like:

  • <cffunction name="arrayFind_CF8">

... and then have logic to re-map the function to a more appropriate name:

  • <cfif (... NOT CF9 ...)>
  • <cfset arrayFind = arrayFind_CF8 />
  • </cfif>

... Using a conditional include (or a conditional CFC invocation) is probably the best so you don't end up with anything unnecessary. But, it comes down to how you currently define your user-defined functions.

please give response ASAP. It is very importent to me.
can we disable admin console in the coldfusion Version: 6,1,0,63958

many thanks

Hey Ben, thanks for the simple things. You're always there when I am searching... :-)

On another note, the "selected" parameter on this type of AJAX form element does not work with CF8, only CF9 in my experience. Do you know a quick workaround to achieve a similar result in CF8?

<cfselect name="serviceID"
bind="cfc:cfc.timer.getServices()"
bindonload="true"
selected="#getTimerData.serviceID#">
</cfselect>

Hi Ben,

I've got an unusual circumstance where I don't have access to the cfadmin AND I can't go through the change request process to add a file dumping the server scope. Are there any configuration files (like the neo-*.xml files) that would give the precise version number?

Thanks Ben! This was helpful. Here is my example taken from your example to get a version number

  • <cfset coldFusionServerVersion = left(SERVER.ColdFusion.ProductVersion, find(',', SERVER.ColdFusion.ProductVersion))>

Hi Ben,
I have the same question as John Longo of obtaining the CF version without going into the adminconsole or dumping server scope. My installation is CF10 on WebSphere.
>>John Longo>>
"Hi Ben, I've got an unusual circumstance where I don't have access to the cfadmin AND I can't go through the change request process to add a file dumping the server scope. Are there any configuration files (like the neo-*.xml files) that would give the precise version number?"