Jump to content

Will not recognize .php files


koka424

Recommended Posts

I just installed MAMP the other day and got it up and running. I put the .php file that I was trying to view in the htdocs folder.  Then I typed in the address:

 

http://localhost:8888/filename.php

 

It worked just fine.

 

Then I get on today and try to view that same file and nothing comes up. No error. Nothing from within the file itself. Just the address in the title bar. I created an .html document and put it into the htdocs folder and can view that just fine. But when ever I try to view the .php file it does nothing. I have tried changing the file extension to another .php type (.php3) and I tried recreating the .php file with different Doc types and nothing happened. The whole thing is that I never changed anything. It just stopped working.

 

Well something had to have changed for it to not read .php files anymore.

 

Please help

Link to comment
Share on other sites

<?php $outputString = "Hello, world"; ?>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/DTD/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Hello, world</title>

</head>

 

<body>

 

<h1> Test </h1>

 

<!--

 

<?php print $outputString; ?>

 

<h1><?php

# Double slash used for one line comment

 

/* Slash and a star

  is used for multiple

  line comments */

 

  print "Hello, world"; ?></h1>

 

 

 

<p>

 

<?php

// Echo used in place of print, can print numbers as well

echo "Hello, world"; ?>

 

<br />

 

<?php echo 123; ?>

 

</p>

 

<?php

// Can print more than one type of data

echo "The answer is ", 42;

 

echo "Hello";

 

// is the same as

 

echo ("Hello"):

?>

 

 

 

</body>

</html>

 

Its not just this file though. I made a couple and it will not read any of them.

Link to comment
Share on other sites

This is the original file that worked last night and not today. In the other ones I tried changing to doctypes and stuff and I got nothing. I am thinking that it has to be something with MAMP. The only thing that I changed on my MAC was changing the wireless network that I signed on to. That should have nothing to do with it. Is there anything that I can check?

 

What I don't get is Ill type in:

 

http://localhost:8888/filename.php

 

and I get nothing.

 

Then I type in:

 

http://localhost:8888/filename.html

 

and I get the file to open up in the browser.

 

Can you think of anything that I can double check?

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.