---
# System prepended metadata

title: PHP Install Guide

---

# PHP Install Guide

## OSX

### Utils
```bash=
# XCode CLI Tools
xcode-select --install

# Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```

### Apache

#### Install
```bash=
brew install openssl httpd 

brew services start httpd
# ==> http://localhost:8080/
# services options: start|stop|restart

# Check if there is an httpd process running
ps -aef | grep httpd

# Check for errors log
tail -f /opt/homebrew/var/log/httpd/error_log

# Apache web server files
open /opt/homebrew/var/www
```

#### Configuration

```bash=
# Edit Apache Configuration
code /opt/homebrew/etc/httpd/httpd.conf

1. Enable 'LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so'
# More info: https://httpd.apache.org/docs/current/mod/mod_rewrite.html


```

### PHP

```bash=
# Install PHP
brew tap shivammathur/php

# Can install multiple versions
brew install shivammathur/php/php@8.0
brew install shivammathur/php/php@8.1

# Link current PHP version with desired
brew unlink php && brew link --overwrite --force php@8.1

# PHP Configuration file
code /opt/homebrew/etc/php/8.1/php.ini

# check version
php -v
```

### PHP as APACHE Module

```bash=
```
