How to Install PHPCI on Manjaro

PHPCI is a continuous integration tool for PHP projects that is used for building and testing PHP code. In this tutorial, we will walk you through the steps to install PHPCI on your Manjaro Linux system.

Prerequisites

Before we start, ensure that your Manjaro system has the following prerequisites:

Step 1 - Downloading PHPCI

First, we need to download the latest version of PHPCI. Open up your terminal and run the following command:

wget https://github.com/Block8/PHPCI/archive/master.zip

Once the download is complete, extract the zip file using the following command:

unzip master.zip

Step 2 - Installing Dependencies

PHPCI requires several dependencies that need to be installed before we can use it. Go to the PHPCI directory inside your terminal and run the following command to install the dependencies:

composer install

Once the installation is complete, we can proceed to the next step.

Step 3 - Configuring PHPCI

PHPCI needs to be configured to run on our system. Navigate to the PHPCI directory and copy the sample configuration file to a new file as follows:

cd PHPCI-master

cp phpci.yml.dist phpci.yml

Next, we need to configure the database settings. Open the phpci.yml file using your preferred text editor and modify the following lines as per your database credentials:

    db:
        dsn: 'mysql:host=localhost;dbname=phpci'
        user: 'phpci'
        pass: ''

Note: here we are using MySQL as the database. You can use MariaDB as well.

Step 4 - Setting Up Apache

We need to set up Apache in order to access PHPCI via a web browser. Navigate to your Apache configuration directory using your favorite text editor:

sudo nano /etc/httpd/conf/httpd.conf

Add the following lines to the end of the file:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/PHPCI-master/public
    ServerName phpci.example.com
    ErrorLog logs/phpci.example.com-error_log
    CustomLog logs/phpci.example.com-access_log combined
    <Directory /var/www/PHPCI-master/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

In case your Manjaro system has already installed the MariaDB as the database management system, you might get the following error message when you try to connect to the database using PDO:

PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

To fix this error, we need to edit the MariaDB server configuration file. To do that, open the specific configuration file for your MariaDB installation:

sudo nano /etc/mysql/my.cnf

Add the following line below the [mysqld] section:

ssl=off

Save the changes and exit the text editor.

Step 5 - Running PHPCI

We have now finished with the installation and configuration process. Restart the Apache web server:

sudo systemctl restart httpd

Open up your web browser and navigate to the server IP address with the following URL:

http://server-ip-address

Here you should be able to see the PHPCI installation page.

Conclusion

PHPCI is now installed on your Manjaro system. You can use it to test and build PHP code for your projects. If you face any issues with the installation process, you can refer back to this guide to resolve them.

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!