Skip to content

Instantly share code, notes, and snippets.

@enemyers
Last active July 14, 2022 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enemyers/5fc7fc652d7378ec6bef88191d2d126a to your computer and use it in GitHub Desktop.
Save enemyers/5fc7fc652d7378ec6bef88191d2d126a to your computer and use it in GitHub Desktop.
Config PHP on macOS Monterey
<< homebrew apache http >>
DocumentRoot is /usr/local/var/www.
The default ports have been set in /usr/local/etc/httpd/httpd.conf to 8080 and in
/usr/local/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.
To restart httpd after an upgrade:
brew services restart httpd
Or, if you don't want/need a background service you can just run:
/usr/local/opt/httpd/bin/httpd -D FOREGROUND
- Edit ServerName localhost:8080 on /usr/local/etc/httpd/httpd.conf
- brew services restart httpd
<< homebrew php >>
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/8.1/
To restart php after an upgrade:
brew services restart php
Or, if you don't want/need a background service you can just run:
/usr/local/opt/php/sbin/php-fpm --nodaemonize
To run correctly code igniter 4 ->
- ucomment on /usr/local/etc/php/8.1/php.ini (not necessary)
- extension=curl
- extension=intl
Restart php: brew services restart php
<< Homebrew composer >>
Brew install composer
- Create larvel project
composer create-project laravel/laravel nameproject-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment