Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

René Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / nginx_dev_installer.sh
Last active February 28, 2025 12:30
Script to install NginX based local development environment on macOS
#!/bin/bash
# nginx_dev_installer -- Install a NginX, PHP, MariaDB development environment on a macOS system.
#
# This development installation runs with PHP 7.4, 8.3 and 8.4.
#
# After installation you can install and run websites on macOS.
# Websites will have a SSL certificate installed.
# For email testing mailpit is provided.
#
@renekreijveld
renekreijveld / template.conf
Created February 28, 2025 10:51
NginX server template for local development on macOS
# http server settings
server {
listen 80;
server_name <website_name>.dev.test;
charset utf-8;
# Enforce HTTPS
return 301 https://$server_name$request_uri;
}
@renekreijveld
renekreijveld / index.php.default
Created February 28, 2025 10:45
Default webste index.php NginX local development on macOS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>#website_name#.dev.test</title>
<!-- Favicon-->
@renekreijveld
renekreijveld / index.php.new
Created February 28, 2025 10:34
New default index file local NginX development on macOS
<?php phpinfo(); ?>
@renekreijveld
renekreijveld / my.cfg.extra
Created February 28, 2025 09:38
Extra settings in the MariaDB condig for local NgniX development on macOS
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
@renekreijveld
renekreijveld / nginx.conf
Last active February 28, 2025 07:51
NginX config for Homebrew based NginX, MariaDB, PHP development stack
# user setting for this machine
user your_username staff;
# you must set worker processes based on your CPU cores, nginx does not benefit from setting more than that
worker_processes auto;
# only log critical errors
error_log /opt/homebrew/var/log/nginx/error.log crit;
events {
@renekreijveld
renekreijveld / php_ini_php84
Last active February 27, 2025 20:44
php.ini for PHP 8.4 macOS NginX development setup
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@renekreijveld
renekreijveld / php_ini_php83
Last active February 27, 2025 20:44
php.ini for PHP 8.3 macOS NginX development setup
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@renekreijveld
renekreijveld / php_ini_php74
Last active February 27, 2025 20:44
php.ini for PHP 7.4 macOS NginX development setup
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@renekreijveld
renekreijveld / sphp
Last active February 27, 2025 20:36
Switch PHP script for macOS NginX development setup
#!/bin/bash
# PHP switcher for Homebrew based NginX, MariaDB, PHP development stack
# Written by: René Kreijveld, july 2024
# Based on the work of Phil Cook and Andy Miller.
homebrew_path=$(brew --prefix)
brew_array=("7.4","8.3","8.4")
php_array=("php@7.4" "php@8.3" "php@8.4")
php_unlink_array=("php@7.4" "php@8.3" "php")
php_version="php@$1"