Thread View: austin.internet
3 messages
3 total messages
Started by the wharf rat
Sun, 08 Mar 2009 17:13
stupid php question
Author: the wharf rat
Date: Sun, 08 Mar 2009 17:13
Date: Sun, 08 Mar 2009 17:13
24 lines
2005 bytes
2005 bytes
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...
Re: stupid php question
Author: Colin Bloch
Date: Mon, 09 Mar 2009 23:09
Date: Mon, 09 Mar 2009 23:09
39 lines
3208 bytes
3208 bytes
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
Re: stupid php question
Author: Colin Bloch
Date: Mon, 09 Mar 2009 23:17
Date: Mon, 09 Mar 2009 23:17
31 lines
2833 bytes
2833 bytes
> > 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads