Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

stupid php question

0 views
Skip to first unread message

the wharf rat

unread,
Mar 8, 2009, 1:13:09 PM3/8/09
to

I'm not a web programmer so I thought I'd beg for a clue here.

Client has complicated web app written in PHP. Runs on old
systems, php4 apache 2 etc. Part of project is new colo, so moved
to modern software, php5, http 2 etc. All works fine except:

Certain pages include inline graphics (image maps) generated by
including the call to the php script that generates the image in the template
of the page. When the page is rendered the href's are resolved and we get
graphics. But for some reason when these scripts execute in the new
environment the output (the <map>...</map><img>...) stuff appears at the
TOP of the page outside the <body> instead of in the middle where the
template actually has the...call?...tag?..whatever. (Is that clear?)

I've played with php output buffering options, inserting various
tags such as table and object around the offending maps, and they still
output at the top of the page. However, <b>stupid graph goes here</b> ends
up in the right place so it's a problem with the way these scripts get
executed when the page is rendered...

I need a clue badly. Anyone got one for me? I'm really just a fancy
sysadmin and not any kind of a programmer never mind this new fangled browser
based stuff...

Colin Bloch

unread,
Mar 9, 2009, 7:09:31 PM3/9/09
to
the wharf rat wrote:.

>
> Client has complicated web app written in PHP. Runs on old
> systems, php4 apache 2 etc. Part of project is new colo, so moved
> to modern software, php5, http 2 etc. All works fine except:
>
> Certain pages include inline graphics (image maps) generated by
> including the call to the php script that generates the image in the template
> of the page. When the page is rendered the href's are resolved and we get
> graphics. But for some reason when these scripts execute in the new
> environment the output (the <map>...</map><img>...) stuff appears at the
> TOP of the page outside the <body> instead of in the middle where the
> template actually has the...call?...tag?..whatever. (Is that clear?)
>
> I've played with php output buffering options, inserting various
> tags such as table and object around the offending maps, and they still
> output at the top of the page. However, <b>stupid graph goes here</b> ends
> up in the right place so it's a problem with the way these scripts get
> executed when the page is rendered...
>


It's pretty tough to say without looking at that specific code, but most
code should run fine on the PHP5 system. I would start by browsing what
is known _not_ to be backwards compatible, and see if anything sticks
out. Try here for starters:

http://us3.php.net/manual/en/migration5.incompatible.php

Failing that, you could run a diff of the old system php.ini vs the new
one. It may seem like a whole lot of output, but the reality is that a
lot of the changes are just wording in comments, and much of it is still
alike and applicable. Might make your head swim for a bit, but there
might be a directive that specifically applies to the problem you're
having.

Good luck!

CAB

Colin Bloch

unread,
Mar 9, 2009, 7:17:52 PM3/9/09
to
>
> It's pretty tough to say without looking at that specific code, but most
> code should run fine on the PHP5 system. I would start by browsing what
> is known _not_ to be backwards compatible, and see if anything sticks
> out. Try here for starters:
>
> http://us3.php.net/manual/en/migration5.incompatible.php
>
> Failing that, you could run a diff of the old system php.ini vs the new
> one. It may seem like a whole lot of output, but the reality is that a
> lot of the changes are just wording in comments, and much of it is still
> alike and applicable. Might make your head swim for a bit, but there
> might be a directive that specifically applies to the problem you're
> having.
>


I thought of one other possibility. If the PHP is being displayed as
actual code instead of executing, then your new Apache server may not
be configured with a handler to recognize that as a PHP script.

For instance, if the file extension is .phtml, you need an AddHandler
directive in the system php.conf (normally in /etc/httpd/conf.d for
Linux systems) to let Apache know when to treat it as script, and not
just display it as HTML.

Anyway, its probably something simple. Hit me via email if you like,
and I'm reasonably certain I'd be able to figure it out just looking
at the page in a browser.

CAB

0 new messages