Httpd on Mac: Difference between revisions
Jump to navigation
Jump to search
Line 52: | Line 52: | ||
SetHandler application/x-httpd-php | SetHandler application/x-httpd-php | ||
</FilesMatch> | </FilesMatch> | ||
</syntaxhighlight> | |||
Check DirectoryIndex includes index.php | |||
<syntaxhighlight lang='xml'> | |||
<IfModule dir_module> | |||
DirectoryIndex index.php index.html | |||
</IfModule> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 02:47, 29 December 2023
Internal
Installation
Start
/opt/brew/opt/httpd/bin/httpd -D FOREGROUND
Start at Boot
sudo brew services start httpd
Directory Layout
/opt └── brew ├── Cellar │ └── httpd │ └── 2.4.58 │ └── bin │ └── httpd ├── etc │ └── httpd │ ├── httpd.conf # Main configuration file │ └── extra │ └── httpd-ssl.conf ├── opt │ └── httpd │ └── bin │ └── httpd └── var ├── www # Document root │ └── index.html │ └── homebrew └── linked └── httpd
Configuration
Configure PHP
Install as shown here:
Add the following to httpd.conf
and restart Apache:
LoadModule php_module /opt/brew/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Check DirectoryIndex includes index.php
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
Miscellaneous
Set ServerName
to localhost:8080.