Jump to content

WAMP Issues


Recommended Posts

Hi I am using WAMP, Firefox, and Notepad++ to learn php. My problem is that the server has trouble displaying the code I am typing sometimes. I am following some video tutorials and I have used the following bits of code.

<html>

<head>

<title>Hello World</title>

</head>

<body>

<?php echo "Hello World!"; ?> <br/>

        </body>

</html>

 

 

<html>

<head>

<title>Variables</title>

</head>

<body>

<?php

$var1 = 10;

echo $var1;

?>

</body>

</html>

 

They work fine sometimes and other times it displays a blank document with the correct title for the page. What would cause this issue. The issue started with the first bit of code. I turned WAMP off and then I turned it back on and it started working fine. What could be the cause? Please help.

Link to comment
https://forums.phpfreaks.com/topic/164180-wamp-issues/
Share on other sites

Ok I realized that it is just not diplaying .php files correctly. I created a basic .html file and it is displaying just fine. but the rest of my (extremely simple) .php files are displaying a blank page. The title does appear at the top of the browser so I know it is at least recognizing the files.

Link to comment
https://forums.phpfreaks.com/topic/164180-wamp-issues/#findComment-866056
Share on other sites

Make sure you're saving your code within .php files. You should also be saving these files within WAMP's www folder (C:/wamp/www).

 

To run your php files you need to be going to http://localhost

Do not try to open your .php files from windows explorer (Rigth click > Open With) or by going to File > Open in your browser. This is not the same as going to http://localhost

 

Also ensure you are using full PHP tags (<?php ?>) and not short tags (<? ?> or <?= ?>). By default short tags are disabled. To enable short tags left click wamp tray icon and select PHP > PHP Settings > short open tag.

Link to comment
https://forums.phpfreaks.com/topic/164180-wamp-issues/#findComment-866628
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.