

To have launchd start php now and restart at login: The php.ini and php-fpm.ini file can be found in: LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.soįinally, check DirectoryIndex includes index.php To enable PHP in Apache add the following to nf and restart Apache: So, if you have already done it, you probably might have noticed some ‘Caveats’: It is supposed that you have also already installed the PHP via HomeBrew. Set the 'ServerName' directive globally to suppress this message So, go to / usr/local/etc/httpd/nf file, open it for editing, find the line ‘Listen 8080’ and change it to ‘Listen 80’.ĪH00558: httpd: Could not reliably determine the server's fully qualified domain name, using pzMacBookPro.local. To 8443 so that httpd can run without sudo”. “ The default ports have been set in /usr/local/etc/httpd/nf This means, that for Homebrew installations, the default configuration file is: The new Apache version installed via brew is Apache/2.4.46 (Unix) and the layout of the installation is located at: Now we can use the following brew commands: Fundamental httpd / apache server commandsīesides the known commands we have previously seen: Now you can check whether the new Apache server works OK by using a browser and the default l8080 port at localhost: The following commands, first start it, and then unloads it from autostart tup. The first we have to do is to disable the pre-installed Apache from running automatically.

That means that we can very easily keep updating with the newest versions of packages installed via Homebrew – independently of the MC OS X updates.ĭisable built-in Apache server from being automatically started Such an approach allows more flexibility for versioning and will continue to work across all macOS versions.
Mac apache restart how to#
See more on how to install Homebrew here. Here, we are going to disable the distributed (pre-installed) version of Apache and use a setup entirely from Homebrew. However, instead of using the delivered version, we’re going to install Apache via Homebrew and then configure it to run on port 80.

Mac apache restart mac os x#
Disable built-in Apache Server and Install a new Apache server via brew – HomebrewĪs we have said, Mac OS X 10.14 Mojave comes with Apache pre-installed. Fundamental httpd / apache server commands:ī. Check if Apache server works OK by using a browser:
