How to Install PHP Censor on macOS
PHP Censor is an open-source continuous integration tool designed specifically for PHP development projects. In this tutorial, we will walk you through the process of installing PHP Censor on macOS.
Prerequisites
Before we begin, make sure that you have the following prerequisites installed:
- PHP 7.1 or later
- Composer
- MySQL/MariaDB or PostgreSQL
Installation Steps
- Clone the PHP Censor repository from GitHub:
git clone https://github.com/php-censor/php-censor.git
- Change the current directory to the root of the cloned repository:
cd php-censor
- Install the required dependencies using Composer:
composer install --no-dev --optimize-autoloader
Create a new MySQL/MariaDB or PostgreSQL database for PHP Censor. You can use the command line or a GUI tool like phpMyAdmin or Adminer for this task.
Rename the
config.yml.examplefile toconfig.yml:
mv config.yml.example config.yml
- Open the
config.ymlfile in a text editor and set the database credentials:
db:
type: pdo_mysql # or pdo_pgsql for PostgreSQL
dbname: phpcensor
host: localhost
username: root
password:
- Configure the SMTP settings if you want to receive email notifications:
notifications:
email_settings:
enabled: true
from_address: [email protected]
from_name: PHP Censor
smtp_host: smtp.gmail.com
smtp_port: 587
smtp_username: [email protected]
smtp_password: your-email-password
smtp_encryption: tls
- Set the URL of your PHP Censor installation:
site_url: http://localhost:8080
- Set the log file location:
log_file: '/var/log/php-censor.log'
- Run the following command to initialize the database tables:
php vendor/bin/phinx migrate -e production
- Start the PHP built-in web server:
php -S localhost:8080 -t public public/index.php
- Open a web browser and go to the URL
http://localhost:8080to access the PHP Censor dashboard.
That's it! You have successfully installed PHP Censor on macOS. You can now use it to automate your PHP project's testing and deployment workflows. Have fun!