Hi - I am just learning PHP. I installed Apache, PHP and MySql on my computer (XP pro) and it is working. I use dreamweaver and when I preview it - my php code works. However, when my code does not work, instead of getting a syntax error, I just get a blank web page, so I have no idea what I am doing wrong. I have no clue how to get the syntax error to show up.

I did notice that the title of my webpage in the firefox tab, when my code works, is the html title, but when it does not work, I get the complete file name and path. I don't know if that means much, but I wanted to mention it in case it did.

Thanks for any help you can provide - I greatly appreciate it!

Dawn

This is a common error. Either it means PHP is not installed properley or that you are using the wrong tags

<? and ?> are called short tags <?php and ?> are called long tags. Certain versions of apache support ONLY long tags. Try this and see if it works. If it works it should display your PHP statistics and settings

<?php

phpinfo();

?>

OK - I did that and it did work - is there some kind of setting in the php config file that I need to change - I'm so afraid to go into that file! :) I did notice that the program I am using (called Web-Developer Controller) has a error log and the parse errors show up in there -but I would really like for them to show up in my browser. I have version 5.2.1 of PHP

Thanks!

Under php.ini there is an option called "short_open_tag". It is probably set to off, or no or false or something like that. Change it and reboot.

Using the short tags is BAD practice though because they can conflict with XMLs tag which is <?xml . However, many (badly written) applications like dreamweaver still use them...

Member Avatar for Rhyan

Under php.ini there is an option called "short_open_tag". It is probably set to off, or no or false or something like that. Change it and reboot.

Using the short tags is BAD practice though because they can conflict with XMLs tag which is <?xml . However, many (badly written) applications like dreamweaver still use them...

The problem has nothing to do with shor or long tags. Using short tags is convenient, however not recomended due to some security issues.

Now, in order to see your errors along with the rest of the code, you have to open the php.ini file and look for a directive named: error_reporting.

You can search for it in the php.ini file. If it has semicolon infront or has no value after the = sign, in order to see all errors you have to set it like this
error_reporting = E_ALL

Then restart the apache in order to reset the php and all your errors will show along with the code.

Good luck.

p.s. Oh, one more thing, check also the value of directive display_errors = .... it should be sent to ON

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.