In this tutorial, we will guide you through the process of installing PHP Censor on NixOS Latest. PHP Censor is an open-source continuous integration tool written in PHP language, which is used to automate the testing and deployment of web applications.
# sudo nix-channel --update && sudo nix-env -iA nixos
# sudo nix-env -iA nixos.php
# php -v
# sudo composer-selfupdate
# composer -v
# sudo nix-env -iA nixos.git
# sudo git clone https://github.com/php-censor/php-censor.git /var/www/php-censor/
# sudo chown -R nginx:nginx /var/www/php-censor/
# cd /var/www/php-censor && sudo composer install
PHP Censor's default configuration file is located at app/config.yml.dist
.
Make a copy of the default configuration file and rename it:
# sudo cp app/config.yml.dist app/config.yml
Edit the app/config.yml
configuration file, adjust it according to your requirements.
Find this section, and uncomment and set the correct configuration option for "database:
database:
adapter: mysql
host: localhost
name: php-censor
user: your-mysql-username
pass: your-mysql-password
Configure the database and create a new database for PHP Censor.
For example, to create the MySQL database, execute:
# sudo mysql -u root -p
And then run:
mysql> CREATE DATABASE php_censor;
mysql> GRANT ALL PRIVILEGES ON php_censor.* TO 'phpuser'@'localhost' IDENTIFIED BY 'phpuser_password';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
# sudo /var/www/php-censor/app/console server:run 0.0.0.0:8080
This command will start the PHP Censor and bind it to the port 8080 on all network interfaces. You can change the port number if needed.
Congratulations! You have now successfully installed PHP Censor, created a database and application configuration, and launched the PHP Censor webserver. Your testing scripts will now automatically run whenever code changes have been pushed to the repository, providing continuous integration for your web applications.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!