0

Last week I started playing around with LAMP Ubuntu and I didnt have any issues. Today some code wasn't working so I tried running this in index.php:

<?php phpinfo(); ?>

This doesn't work when I connect to localhost in my browser, but it works in testphp.php at localhost/testphp.php

Any suggestions?

Thanks

4
  • 2
    What about http://localhost/index.php? Commented Oct 21, 2010 at 4:26
  • 1
    Can you copy and paste the code? Commented Oct 21, 2010 at 4:26
  • MAy be not for you...but it will be helpful for us if you provide code here Commented Oct 21, 2010 at 4:28
  • Obvious attempt, but did you try restarting the server? Commented Oct 21, 2010 at 4:31

2 Answers 2

1

Try renaming the file to index.php

Sign up to request clarification or add additional context in comments.

2 Comments

@chetan: i believe he's got the same point as zerkms' What about localhost/index.php?
I have a shortcut index.html that points to index.php, and localhost/index.html doesn't work. What could have happened to the shortcut that disabled php?
0

If you mean that code doesn't get executed when you access http://localhost/, then you should try to add
DirectoryIndex index.html index.php
to your apache's conf file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.