HTML as PHP

All MAMP discussions around troubleshooting and anything related to MAMP. Be as detailed as possible here when posting an issue.
Post Reply
WrongSizeGlass
Posts: 10
Joined: Wed Jul 10, 2024 1:30 pm

HTML as PHP

Post by WrongSizeGlass »

I'm having trouble with MAMP 7.x handling .html files as .php files on a new Mac.

I've done this for many years with previous versions of MAMP by adding the following to the httpd.conf file:

Code: Select all

AddType application/x-httpd-php .php .phtml .html
Normally, Apache (via MAMP or on Linux) treats the HTML as a PHP file and resolves any PHP variables/placeholders that are in the HTML. With MAMP 7.x, the browser tries to download the requested HTML file (this is typical of not adding the above line to the Apache config file).

I tried to install 6.9 on this new Mac (that is the version running on my other Mac without any issues), but I get an error that 6.9 cannot run unless a previous version of 6.x was installed on the Mac.

Has anyone run into this issue with MAMP 7.x? Or is anyone else running .html files as .php successfully on 7.x?

Thanks,
WSG
Post Reply