views:

40

answers:

2

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

A: 

Try renaming the file to index.php

ensnare
Didn't the question say he entered that code in `index.php`?
Chetan
@chetan: i believe he's got the same point as zerkms' What about http://localhost/index.php?
lock
http://localhost/index.php works!
Cody
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?
Cody
A: 

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.

galymzhan