Blank php Page
Posted by: sd04 (---.cis.strath.ac.uk)
Date: February 13, 2013 01:26AM

Hi,

Installed WAMP earlier today, but having some issues with my php. Basically whenever I run a webpage with any php in it, the php comes up blank. Everything in WAMP is running and my little icon is green. Also phpmyadmin runs fine as does Localhost.

I'm sure it's just something really stupid I've done wrong, but any help would be much appreciated! Thanks!

Options: ReplyQuote
Re: Blank php Page
Posted by: RiggsFolly (---.as13285.net)
Date: February 13, 2013 01:38AM

Does the php appear to do nothing or do you see the php in the web page?

Options: ReplyQuote
Re: Blank php Page
Posted by: sd04 (---.cis.strath.ac.uk)
Date: February 13, 2013 01:51AM

It appears to do nothing in the web page.

EDIT: Sorry, that's a lie. I see the php script, or most of it, in the web page. An example,

<?php
echo "Line 1</br>";
echo "Line 2</br>";
?>

shows

"; echo "Line 2
"; ?>

in the web page.



Edited 1 time(s). Last edit at 02/13/2013 01:56AM by sd04.

Options: ReplyQuote
Re: Blank php Page
Posted by: RiggsFolly (---.as13285.net)
Date: February 13, 2013 02:10AM

Try this instead.


<?php
echo 'Line 1<br />';
echo 'Line 2<br />';
?>

the '\' is a special character, the escape character, when used in a double quoted string or heredoc's.
html for a line break is <br> or <br />

If you dont expect to use variables or special characters in a string use the single quote. It stops mistakes and is self documenting.

Have a quick read on this page:
http://php.net/manual/en/language.types.string.php

Options: ReplyQuote
Re: Blank php Page
Posted by: sd04 (---.cis.strath.ac.uk)
Date: February 13, 2013 02:17AM

Thanks, but this is still producing the same result on the webpage.

It's not just my dodgy strings that are the problem- I've been working on a webpage that calls a function to display the header and footer. On the uni computers, which are all set up for this, it works wonderfully. But when I try it on my home computer (the one with WAMP), it just displays the php code that calls the function.

Options: ReplyQuote
Re: Blank php Page
Posted by: RiggsFolly (---.as13285.net)
Date: February 13, 2013 02:27AM

Is your code using <?=$var_name?> style php

If so you need to turn short_tags on in the php.ini file

left click wampmanager icon -> PHP -> php.ini

look for the parameter > short_open_tag and set it to > On

Options: ReplyQuote
Re: Blank php Page
Posted by: sd04 (---.cis.strath.ac.uk)
Date: February 13, 2013 02:32AM

Yes, it is. Done, restarted all services.

Same result. D=

Options: ReplyQuote
Re: Blank php Page
Posted by: RiggsFolly (---.as13285.net)
Date: February 13, 2013 02:34AM

Have you got Team Viewer? If not install it and I will have a look.

Send e Private message with the ID and Password.

Options: ReplyQuote
Re: Blank php Page
Posted by: stevenmartin99 (Moderator)
Date: February 13, 2013 06:00AM

stop open the php page by double clicking it.


YOU MUST use localhost/filename.php

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Blank php Page
Posted by: RiggsFolly (---.as13285.net)
Date: February 13, 2013 10:15AM

It was a couple of problems

1. They were clicking the .php file from Explorer as you thought.
2. They had a manually installed Apache that had not quite uninstalled properly.
3. There was a manually installed MYSQL5 that was not uninstalled at all and was running.


For others that see this thread.

You should not have multiple installs of Apache and/or MYSQL
If you have tried to install them manually and seperately ( which is quite possible ) or tried and failed to get XAMPP up and running and then given up and found WAMP Server, please make sure you properly and completely uninstall those other attempts before trying to install WAMP.

Options: ReplyQuote


Sorry, only registered users may post in this forum.