{"id":35472611,"url":"https://github.com/thomasisberg/macos-web-development","last_synced_at":"2026-01-03T11:04:12.073Z","repository":{"id":208385571,"uuid":"241385757","full_name":"thomasisberg/macos-web-development","owner":"thomasisberg","description":"Installation script for MacOS web development AMP stack (Apache, MySQL and PHP).","archived":false,"fork":false,"pushed_at":"2025-12-17T14:22:24.000Z","size":114,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-21T02:47:10.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomasisberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-18T14:43:17.000Z","updated_at":"2025-12-17T14:22:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbb923cc-9044-4f36-beaf-b008699c95ff","html_url":"https://github.com/thomasisberg/macos-web-development","commit_stats":null,"previous_names":["thomasisberg/macos-web-development"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/thomasisberg/macos-web-development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasisberg%2Fmacos-web-development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasisberg%2Fmacos-web-development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasisberg%2Fmacos-web-development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasisberg%2Fmacos-web-development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomasisberg","download_url":"https://codeload.github.com/thomasisberg/macos-web-development/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomasisberg%2Fmacos-web-development/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28188361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-03T02:00:06.471Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-03T11:03:25.332Z","updated_at":"2026-01-03T11:04:12.065Z","avatar_url":"https://github.com/thomasisberg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# macos-web-development\n\nInstalls macOS web development AMP stack (Apache, MySQL and PHP).\n\n\n## Why macos-web-development?\n\n### Because you want to\n\n```bash\n./macos-web-development.sh --no-dry-run\n```\n\n... and then instantly create a cool PHP based website at http://cool.test\n\n```bash\nmkdir -p ~/WebServer/sites/cool/public \u0026\u0026 echo \"\u003ch1\u003eCool\u003c/h1\u003e\" \u003e\u003e ~/WebServer/sites/cool/public/index.php\n```\n\n... without reading tutorials and performing installation steps manually. 🤩\n\nYou will also be able to create http://cool.com.test or http://cool.co.uk.test or whatever.\n\n### Also\n\nBecause you want to manage your own stack of independent software, which you are free to mess around with in any way you want. Macos-web-development simply installs packages, mostly with [Homebrew](https://brew.sh) (which is also automatically installed), and edits configuration files.\n\n\n\n## Features\n\n- **Browse** `http://{any}.test` to visit `~/{user}/WebServer/sites/{any}/public` (fully customizable path).\n- **Switch** between PHP versions 5.6 to 8.4 using command `sphp {version}`, for example `sphp 8.4`.\n- **Distribute** Apache vhosts configuraton and PHP ini from template files in repository. Simply adjust them to your needs before installation... or not. 🙃\n- **Opt out** of software you don't want. For example `--no-mysql`.\n- **Dry run** – check which software is already installed etc. This is the default behaviour, use `--no-dry-run` to actually install stuff.\n- **Uninstall** – removes most stuff, but not all. ☝️ [See details below](#uninstallation-1).\n\n### Apache configuration\n\nAfter installation the Apache vhosts configuration is found at `/usr/local/etc/httpd/extra/httpd-vhosts.conf` for Intel based macs and at `/opt/homebrew/etc/httpd/extra/httpd-vhosts.conf` for newer macs. Change it whenever you want and restart Apache using `brew services restart httpd`.\n\n\n### PHP ini\n\nThe custom PHP ini file is installed as a symlink in each PHP version, pointing to `/usr/local/php/php.ini`. One file for all PHP versions = enjoy. 🥳\n\n\n## Installing macos-web-development (self installation)\n\n**macos-web-development** was originally not intended to be installed, and works fine by just executing `./macos-web-delopment.sh` from your downloaded repository. You may just as well skip this chapter and go straight to [Usage](#usage) below 🙃.\n\nIf you self install macos-web-development you can execute it from anywhere by replacing `./macos-web-delopment.sh` with `macos-web-delopment` in the Usage instructions below. This is primarily useful for future [complementary installations](#complementary-installation).\n\n\n#### How to self install\n\n```bash\n./self-install\n```\n\n* Installs files to `/usr/local/macos-web-development/`.\n* Creates executable symlink at `/usr/local/bin/macos-web-development` (should be in your `$PATH`).\n\n\n#### Caveats\n\nWhen you self install macos-web-development, the templates for Apache and PHP configurations are also installed, so you need to tweak them (if desired) before self installation.\n\nYou can always perform a new self installation to update macos-web-development (and your templates).\n\n\n## Usage\n\nReplace `./macos-web-delopment.sh` with `macos-web-delopment` in all code instructions below if you have [self installed macos-web-development](#installing-macos-web-development-self-installation).\n\n#### Full installation (dry run with info)\n\n```bash\n./macos-web-development.sh\n```\n\n\n#### Full installation\n\n```bash\n./macos-web-development.sh --no-dry-run\n```\n\n\n#### Installation with selected version of PHP and no MySQL\n\n```bash\n./macos-web-development.sh --only-php-8.2 --no-mysql --no-dry-run\n```\n\n\n#### Installation with preset\n\n##### Common\n\nInstalls mandatory stuff and **Apache**, **MySQL**, **PHP 8.3** and **Dnsmasq**.\n\n```bash\n./macos-web-development.sh --p-common --no-dry-run\n```\n\n##### Minimal\n\nInstalls mandatory stuff and **Apache**, **PHP 8.3** and **Dnsmasq**. No **MySQL**.\n\n```bash\n./macos-web-development.sh --p-minimal --no-dry-run\n```\n\n\n#### Uninstallation\n\nMaybe you're poking around with your computer and want to *uninstall... install... uninstall... install...* 😎\n\n```bash\n./macos-web-development.sh --uninstall --no-dry-run\n```\n\n\n#### See the help for all details\n\n```bash\n./macos-web-development.sh --help\n```\n\n\n## Installed software\n\nThe following software is included in a full installation.\n\n- **xcode-select** Xcode command line developer tools. You probably already have this... feel free to pass `--no-xcode-select`.\n- **Homebrew**\n- **Openldap**\n- **Libiconv**\n- **MySQL**\n- **Dnsmasq** to be able to browse `http://{any}.test`\n- **Apache** some say it's better with Homebrew than the MacOS default. 🤷‍♂️ Script based Apache PHP configuration (and PHP switching with `sphp`) only works with a Homebrew:ed Apache.\n- **PHP** versions 5.6 to 8.1\n- **sphp** a PHP switching script\n\nAll of the above will only be installed if not already on the machine. However, **Apache** and versions of **PHP** will only be skipped by default if they were already installed with **Homebrew**. If not, they will be installed with Homebrew and replace existing ones, which will remain untouched on the system. Should you choose to uninstall with macos-web-development, the existing software should be brought back to life, as if nothing ever happened.\n\n\n### Uninstallation\n\n- Will not uninstall **xcode-select**, **Homebrew** and **Openldap**.\n- Will not remove the server root folder at `~/WebServer/sites` (or the folder you specified), or any websites in there.\n- Will uninstall the **MySQL server**, but will not remove any **databases**.\n- Takes no other options than `--no-dry-run` and will always uninstall all supported versions of **PHP** etc.\n\n\n### Complementary installation\n\nShould you decide that you need a specific feature after installation without it, just execute a new installation. Installed software will be left alone, and only the missing packages will be installed.\n\n#### To only install a new version of PHP (8.2 in this example)\n\n```bash\n./macos-web-development.sh --only-php --only-php-8-2 --no-dry-run\n```\n\n\n## Options\n\nOption                                    | Description\n:---                  | :---\n`-h` or `--help`      | Display help.\n`--no-apache`         | Skip Apache.\n`--no-dnsmasq`        | Skip Dnsmasq. You just won't be able to browse `http://{any}.test` to automatically visit `~/WebServer/sites/{any}/public`. Virtual hosts can still be managed manually.\n`--no-dry-run`        | Disable dry run and actually install stuff.\n`--no-mysql`          | Skip MySQL.\n`--no-php`            | Skip PHP.\n`--no-php-5-6`        | Skip PHP 5.6\n`--no-php-7-0`        | Skip PHP 7.0\n`--no-php-7-1`        | Skip PHP 7.1\n`--no-php-7-2`        | Skip PHP 7.2\n`--no-php-7-3`        | Skip PHP 7.3\n`--no-php-7-4`        | Skip PHP 7.4\n`--no-php-8-0`        | Skip PHP 8.0\n`--no-php-8-1`        | Skip PHP 8.1\n`--no-php-8-2`        | Skip PHP 8.2\n`--no-php-enable`     | Don't automatically enable the latest version of PHP in currently executing installation.\n`--no-xcode-select`   | Skip Xcode command line developer tools.\n`--only-apache`       | Only install Apache.\n`--only-dnsmasq`      | Only install Dnsmasq.\n`--only-mysql`        | Only install MySQL.\n`--only-php`          | Only install PHP.\n`--only-php-5-6`      | Only install PHP 5.6. Combine with `--only-php` if desired.\n`--only-php-7-0`      | Only install PHP 7.0. Combine with `--only-php` if desired.\n`--only-php-7-1`      | Only install PHP 7.1. Combine with `--only-php` if desired.\n`--only-php-7-2`      | Only install PHP 7.2. Combine with `--only-php` if desired.\n`--only-php-7-3`      | Only install PHP 7.3. Combine with `--only-php` if desired.\n`--only-php-7-4`      | Only install PHP 7.4. Combine with `--only-php` if desired.\n`--only-php-8-0`      | Only install PHP 8.0. Combine with `--only-php` if desired.\n`--only-php-8-1`      | Only install PHP 8.1. Combine with `--only-php` if desired.\n`--only-php-8-2`      | Only install PHP 8.2. Combine with `--only-php` if desired.\n`--only-xcode-select` | Only install Xcode command line tools.\n`--p-common`          | Common preset. Sets options `--only-php-8-1 --no-xcode-select`\n`--p-minimal`         | Minimal preset. Sets options `--no-mysql --only-php-8-1 --no-xcode-select`\n`--script-repo=`      | Used in combination with `--self-update`. Sets URI to repository if you want to override the default one. Primarily implemented to be able to self update even if the standard repository have been moved.\n`--self-update`       | Update macos-web-development to latest version. Takes no other options than `--script-repo` and `--no-dry-run`.\n`--uninstall`         | Uninstall. Takes no other options than `--no-dry-run` and will uninstall all versions of PHP etc.\n\n\n## Credit\n\n### Setup is based on these resources\n\n- *(This link is broken and I can't find the resource elsewhere. I'm keeping it anyway.)* [The Perfect Web Development Environment for Your New Mac](https://mallinson.ca/posts/5/the-perfect-web-development-environment-for-your-new-mac) by Chris Mallinson.\n- [macOS 10.15 Catalina Apache Setup: Multiple PHP Versions](https://getgrav.org/blog/macos-catalina-apache-multiple-php-versions) by Andy Miller.\n- [How To Install Apache on macOS 10.15 Catalina Using Homebrew](https://medium.com/better-programming/how-to-install-apache-on-macos-10-15-catalina-using-homebrew-78373ad962eb) by Casey McCullen.\n- [How To Install a PHP 7.2 on macOS 10.15 Catalina Using Homebrew and PECL](https://medium.com/better-programming/how-to-install-a-php-7-2-on-macos-10-15-catalina-using-homebrew-and-pecl-ad5b6c9ffb17) by Casey McCullen.\n\n### sphp\n\nOriginal script by Andy Miller: [Easy Brew PHP version switching](https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2).\n\nIt has been slightly modified to work well with **macos-web-development**.\n\n\n## Requirements\n\n### macOS tests\n\n- **macOS Monterey** *(12.1)* – successfully tested.\n- ~~macOS Big Sur~~ *(11.x)* – **not tested**.\n- **macOS Catalina** *(10.15.3)* – successfully tested.\n- ~~**macOS Sierra~~ *(10.12.6)* – **tested without success**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasisberg%2Fmacos-web-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomasisberg%2Fmacos-web-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomasisberg%2Fmacos-web-development/lists"}