You are not logged in.

#1 2007-07-22 16:29:21

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

php not parsing php!

I've just installed php on a new server and spent the last couple of hours trying to work out why apache wasn't parsing php.

I tried all the usual stuff like the module isn't loaded and things like that but still no luck.

With the help of a friend we finally tracked it down to this setting in php.ini

short_open_tag = Off

All the pages I was testing have the short tags i.e. <? rather than the long ones i.e. <?php and because php was ignoring short tags nothing was being processed. A quick change to

short_open_tag = On

and all is now working.

This was a change in the default behavior by php which really threw me so I thought I'd make this entry just in case anyone else has this problem.

Offline

#2 2007-07-22 21:03:04

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: php not parsing php!

use <?php, NOT <?


http://timtux.net/ - my personal blog about almost everything

Offline

#3 2007-07-22 21:38:06

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: php not parsing php!

Thats fine for new builds but having 4 years worth of sites built using <? I'm not going back and updating them all. (ye, could do global search and replace but would any of you honestly trust it?)

And typing <? is habit!

Offline

#4 2007-07-22 21:45:35

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: php not parsing php!

You shouldn't have used <? in the first place, it's been long time discouraged by the php manual. It's about time they [the php developers] throw out stuff like that.

Last edited by RedShift (2007-07-22 21:45:50)


:?

Offline

#5 2007-07-23 04:24:04

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: php not parsing php!

dninja wrote:

Thats fine for new builds but having 4 years worth of sites built using <? I'm not going back and updating them all. (ye, could do global search and replace but would any of you honestly trust it?)

And typing <? is habit!

A rather simple sed-script sould fix that on your project, but I sux at sed so I can't help you smile


When death smiles at you, all you can do is smile back!
Blog

Offline

#6 2007-07-23 08:30:30

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: php not parsing php!

A rather simple sed-script sould fix that on your project, but I sux at sed so I can't help you smile

It should fix it but there is no way I would trust automating that kind of thing over something so important!

Offline

#7 2007-07-23 08:42:38

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: php not parsing php!

dninja wrote:

A rather simple sed-script sould fix that on your project, but I sux at sed so I can't help you smile

It should fix it but there is no way I would trust automating that kind of thing over something so important!

Thats why you have a separate development server for such stuff smile

Or a separate VHOST atleast.


When death smiles at you, all you can do is smile back!
Blog

Offline

#8 2007-07-23 08:55:31

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: php not parsing php!

High|ander wrote:
dninja wrote:

A rather simple sed-script sould fix that on your project, but I sux at sed so I can't help you smile

It should fix it but there is no way I would trust automating that kind of thing over something so important!

Thats why you have a separate development server for such stuff smile

Or a separate VHOST atleast.

I have 3 servers for it all (dev, test and live) but  it is still a lot of work to take 4 years worth of projects, update them all, test them all, get client sign off on the testing, and the roll them out. Basically it isn't practical.

I found the problem with I installed a new dev server, checked a project out of svn and found that not much worked!

Offline

#9 2007-07-23 10:13:26

High|ander
Member
From: Skövde, Sweden
Registered: 2005-10-28
Posts: 188
Website

Re: php not parsing php!

Okay, I see what you mean. Then I see your point.

It is hard when you have clients(people) that are paying for the software. Hard to get paid for "Just fixed some code standards".


When death smiles at you, all you can do is smile back!
Blog

Offline

#10 2007-07-23 13:15:30

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: php not parsing php!

The other problem is third party apps. I use a lot of open source apps and can't guarantee that all those follow the standards.

And clients do tend to get arsey when you send them a bill for fixing things that already work!

Offline

Board footer

Powered by FluxBB