Thursday, January 08, 2009

Dear Lazyweb: I am frustrated by PHP

Dear Lazyweb,

When I run a PHP [1] script that contains this line

24. define("GRID_SOURCE", "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\slGrid-2.0\2.0\");
26. include(GRID_SOURCE."class/gridclasses.php"); //Include the grid engine.

this is written to error.log

[Thu Jan 08 11:27:37 2009] [error] [client] PHP Parse error: syntax error, unexpected T_CLASS in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\slGrid-2.0\\2.0\\view.php on line 26, referer:

What in the world is wrong with line 26? I stare and stare and the it sure does SEEM correct.

Update a few minutes later ...

Duh - I'm an idiot. Replace '\' with '/' on line 24 and you're set.

I gotta think this isn't an error an actual PHP coder would make. I looked at that line and eighteen years of looking at a DOS command prompt told me it was 'right'.

[1] I have this in my .sig file: "PHP is what Microsoft would invent if they were trying to clone Perl."
blog comments powered by Disqus