1
votes

I have a problem that is driving me crazy.I just want to execute a simple php script on my macbook pro with the native apache of mac OS.

I did all the step of configurations succesfully: -Activate the web sharing -Uncomment LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf -Uncomment Include /private/etc/apache2/extra/httpd-userdir.conf -Restart apache in the terminal with:sudo apachectl restart -I put the php script in the folder Site

The script is just:

<?php
echo "Hello";
?>

When I try to launch it in the url with:http://localhost/~user/connect.php I always see the code over and not Hello. I don't see what I did wrong and I can't find the solution on the Web

Thank you for your answers.

Quentin

1

1 Answers

0
votes

Make sure you mark files ending in .php to be excecuted as a script, you can do that with a .htaccess

AddType application/x-httpd-php .php