phpstarter-cli/README.md

65 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# PHPStarter CLI
A lightweight commandline tool for generating new PHP websites based on the [PHPStarter](https://gitea.ramoncaballero.dev/mon/PHPStarter.git) template.
You get a fully working PHP project in seconds.
## Requirements
- Linux environment
- Apache2
- Git
- Bash
- PHP
- Composer
- MariaDB
## Installation
Clone this repository:
```bash
git clone https://gitea.ramoncaballero.dev/mon/phpstarter-cli.git
cd phpstarter-cli
```
Make the script executable:
```bash
chmod +x phpstarter.sh
```
<!-- (Optional) Install globally: -->
<!-- -->
<!-- ```bash -->
<!-- sudo cp phpstarter.sh /usr/local/bin/phpstarter -->
<!-- ``` -->
## Usage
Create a new PHP site:
```bash
sudo ./phpstarter.sh <mysite>
```
This will clone the [PHPStarter](https://gitea.ramoncaballero.dev/mon/PHPStarter.git) template, configure everything automatically, and set up a readytouse local development environment for your new site.
Your new site will be available at:
```bash
http://mysite.local
```
## Remove a Site
```bash
sudo rm -rf /var/www/sites/mysite
sudo a2dissite mysite.conf
sudo rm /etc/apache2/sites-available/mysite.conf
sudo systemctl reload apache2
sudo sed -i '/mysite\.local/d' /etc/hosts
```
You may also remove the database it manually if you no longer need it.