Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've tried to install MAMP (also the "manual version of these things) but I haven't got any PHP enabled response from my web server yet....

Running MAMP and loading localhost/index.html returns "It works!"

Well that's nice - if it were true... I've tried to load my own index.html file into MAMP/htdocs (default folder) and to load the same into the sites folder. Both locations will return the test part of the file, but not the response from e.g. this file:

<html>
<body>

<?php
echo "Hello World";
?>
test
</body>
</html>

The only result here is "test" - what am I missing here?

share|improve this question
    
It might be helpful if you detailed what commands you ran (and the resulting output if possible) to get to this point. It's been a while since I've done any AMP stuff, but it seems like Apache may not be configured with PHP support. –  robmathers Nov 28 '12 at 20:06
3  
Have you tried changing the filename to index.php? Apache may not be configured to process PHP code within HTML files. –  maniacyak Nov 28 '12 at 20:25
    
It seems like it's serving files with the .php ending fine. How do I change the setting so apache will serve HTML files including php too? –  noesgard Nov 29 '12 at 20:21
    
How do I change the setting so apache will serve HTML files including php too? -> stackoverflow.com/a/4892577/1287812 –  brasofilo Sep 10 '13 at 21:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.