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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.