upgrade to php 5.3 shows variable names

floyd

Verified User
Joined
Mar 29, 2005
Messages
6,173
I upgraded to php 5.3 and now on some scripts the variable names show instead of their values. Any idea why?

Getting an update from the script writers is not an option since they are no longer around. I would like to fix what is in place.

Code:
$forum_name
$forum_description
$forum_subforums	
$forum_topics	
$forum_posts	
$forum_last_post
 
I dont know why.

Maybe because your code is as folows
echo "$forum_name"

then try to change it to
echo $forum_name

Can you copy paste some piece of code?

Did you upgrade from a very old php version or from 5.2 to 5.3 ?
 
Yes I upgraded from 5.2 to 5.3 and now what gets displayed on the page is the above instead of the values of said variables. Variables are not getting processes but printed as literal. I would like to know what the difference is between 5.2 and 5.3 that would cause that.

I don't expect the code to be examined but just to know what changed in php.
 
You will have to give us more information.
Maybe a link to the page in particular
or a screenshot?

It could be that php is not running,
try to make a php page for example

info.php
<?php phpinfo(); ?>
and try to request the page
 
I had to downgrade to 5.2 to get it to work again. I am trying to find a solution or at least something to try before upgrading again.

Thank you for trying to help but I know how to do basic diagnostics to see if php is "running", I think you mean "working."

Simply put 5.2 processes a variable and displays the value of the variable, 5.3 displays the variable name such as $page_title instead of the actual page title.

Something has changed in the way variables are used or written in php 5.3. It may have something to do with quotes or double quotes or something else.
 
I've never seen something like this,
if you want to resolve it, you will need someone to investigate it further.

Also, did you try to put the phpinfo page on the same domain, or in the same directory.
Did the php info page show correctly?
 
mmmh so ive no more ideas at the moment, is pretty strange cause it looks like is not loading php from apache...

Regards
 
There hundreds of other php scripts running just fine.

Some feature has changed between 5.2 and 5.3 that causes this behavior.
 
Some feature has changed between 5.2 and 5.3 that causes this behavior.

No.

First, check if this script is for sure parsed by php: add some phpinfo() inside.
Second, check source of this script.
 
Back
Top