Reputation: 145
I am trying to Apache, MySQL & PHP on macOS Big Sur.
I have followed this guide: https://tobschall.de/2020/11/01/big-sur-mamp/
And have configured my
/etc/apache2/extra/httpd-vhosts.conf
as
<VirtualHost *:80>
DocumentRoot "/Users/myname/Sites/test"
ServerName local.idex
</VirtualHost>
and my
/etc/hosts
127.0.0.1 localhost local.test
255.255.255.255 broadcasthost
::1 localhost
if I put the following php file (phpinfo.php
)
echo '<?php phpinfo();' > /Library/WebServer/Documents/phpinfo.php
in the test directory and type http://localhost/phpinfo.php in a browser, I get
echo '<?php phpinfo();' > /Library/WebServer/Documents/phpinfo.php
which is basically what I put on the file.
Looks like the php is not working :-(
I have checked:
Any idea ?
Upvotes: 1
Views: 646
Reputation: 11
For those with the same problem. I found the solution here (https://wpbeaches.com/install-apache-mysql-php-on-macos-11-big-sur-and-earlier-macos/) Just add
LoadModule php7_module libexec/apache2/libphp7.so
in your /etc/apache2/httpd.conf file.
Upvotes: 1