# Set Up PHP Development Environment

[![www.php.net](https://img.shields.io/badge/www.php.net-0288D1?style=flat)](https://www.php.net/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://www.php.net/manual/en/)
[![php/php-src](https://img.shields.io/badge/php/php--src-555555?style=flat&logo=github&logoColor=white)](https://github.com/php/php-src)

Installation
-------------

```shell distribution="Debian"
sudo apt install php-cli php-curl php-mbstring php-mysql php-pdo php-sqlite3 php-xml php-zip
```

### Install Composer from Official Distribution

[![getcomposer.org](https://img.shields.io/badge/getcomposer.org-0288D1?style=flat)](https://getcomposer.org/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://getcomposer.org/doc/)
[![downloads](https://img.shields.io/badge/downloads-0f7d15?style=flat)](https://getcomposer.org/download/)

```shell
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'c8b085408188070d5f52bcfe4ecfbee5f727afa458b2573b8eaaf77b3419b0bf2768dc67c86944da1544f06fa544fd47') { echo 'Installer verified'.PHP_EOL; } else { echo 'Installer corrupt'.PHP_EOL; unlink('composer-setup.php'); exit(1); }"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

```shell
sudo chown root:root composer.phar
sudo mv composer.phar /usr/local/bin/composer
```

### Install Laravel Globally

[![laravel.com](https://img.shields.io/badge/laravel.com-0288D1?style=flat)](https://laravel.com/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://laravel.com/docs)
[![laravel/laravel](https://img.shields.io/badge/laravel/laravel-555555?style=flat&logo=github&logoColor=white)](https://github.com/laravel/laravel)

```shell
composer global require laravel/installer
```

```shell
echo 'export PATH="$(composer global config bin-dir --absolute --quiet):$PATH"' >> ~/.bashrc
```