skip to Main Content

Upgraded to Mac OS 12 today and noticed PHP was removed. Have installed PHP 8 using brew. I’ve tried setting it up with the default httpd and also tried installing it with brew. I load the module in the config. In both cases, when I access the files on the localhost in my browser, it just prints the text in the php files and doesn’t execute them. Haven’t really got any clue left

2

Answers


  1. You need to add the line AddType application/x-httpd-php .php to httpd.conf Apache configuration file to enable PHP file parsing. After editing the file restart Apache to reload new settings.

    Login or Signup to reply.
  2. You can use an alternative like MAMP (My Apache MySQL and PHP). Installation instructions here: https://documentation.mamp.info/en/MAMP-Mac/Installation/.

    It includes a prepackaged Apache/nginx web server, PHP and MySQL, as well as, a management GUI app native to macOS.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search