I am using homebrew to set up Apache and PHP on MacOS Monterey since Apple no longer supports PHP. I have successfully installed homebrew and have been following the instructions at How to Setup MAMP (MacOS, Apache, MySQL, PHP) Local Server on macOS 12 Monterey M1 Mac (2021). I have also checked the homebrew console output which tells me that whereas tech-cookbook refers to /opt/homebrew/etc/httpd/ this should be replaced by /usr/local/opt/httpd/
The installation seems to have worked OK:
% brew services restart httpd
Stopping `httpd`... (might take a while)
==> Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
% brew services restart php
Stopping `php`... (might take a while)
==> Successfully stopped `php` (label: homebrew.mxcl.php)
==> Successfully started `php` (label: homebrew.mxcl.php)
But when I try to access localhost via browser I get
Unable to connect
An error occurred during a connection to localhost.
I have checked the content of httpd.conf many times. Can anyone suggest how to find out what's wrong?
Thank you.
- Malcolm
The installation seems to have worked OK:
% brew services restart httpd
Stopping `httpd`... (might take a while)
==> Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
% brew services restart php
Stopping `php`... (might take a while)
==> Successfully stopped `php` (label: homebrew.mxcl.php)
==> Successfully started `php` (label: homebrew.mxcl.php)
But when I try to access localhost via browser I get
Unable to connect
An error occurred during a connection to localhost.
I have checked the content of httpd.conf many times. Can anyone suggest how to find out what's wrong?
Thank you.
- Malcolm