I'm writing a php application around the websever I setup inside my house. It's a fedora10 machine, running php5 and mysql. I've code such as this:

<?php echo $var->function(); ?>

But for whatever reason the -> is closing the php tag, therefore the output has 'function() ?' put into it...can there be something I have to alternation in my php or webserver configuration?

I dont think you have mod_php enabled inside your apache config file, otherwise you would not begin to see the php code within the output. Here is a good tutorial on establishing php 5 in apache.


<?php echo("foo"); ?>

In the event that does not work, you do not have PHP enabled in Apache.

If your're certain php is enabled, try that one

$result = $var -> function();
echo $result;

to debug it just a little.. maybe something interesting will raise

May be the php enabled on server? An easy test for identifying it:

<?php phpinfo();?>

Place the above line inside a .php file and can get on.

You might do this:

<?php phpinfo();

Final closing php tag is not needed.

I went right into a similar problem yesterday however i was using bar ?> rather than bar ?>

It switched out the short_open_tag option was disabled during my PHP configuration.

I'd exactly the same trouble with a typical XAMPP installation. short_open_tag=On solved it.