Install PIMCore on CentOS 8

Updated on November 21, 2023
Install PIMCore on CentOS 8 header image

Introduction

PIMCore is a free and open-source enterprise Content Management System (CMS) based on PHP. It has both on-premise and cloud installation options with a wide open-source tech stack. It provides multiple integrated applications such as product information management, e-commerce, digital asset management, multi-channel publishing, marketing management and so on. It has an intuitive user interface that is fully responsive and runs on all devices. This article explains how to install PIMCore on a CentOS 8 server.

Prerequisites

Perform the following steps first:

Server Requirements

  • Apache >= 2.4
  • PHP >= 8.0
  • MySQL >= 8.0 or MariaDB >= 10.3

Step 1. Install Packages

Update the system packages.

$ yum -y install epel-release

$ yum -y update

Install Apache, MySQL server, and other packages.

$ sudo yum -y install httpd mysql-server wget unzip

Start Apache service and enable it to start on boot.

$ sudo systemctl start httpd

$ sudo systemctl enable httpd

Install PHP version 8.0. Add the repositories.

Add Remi repository, a third-party repository that provides PHP versions.

$ sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Install Remi module.

$ sudo dnf module install php:remi-8.0 -y

Install PHP version 8.0 and other modules.

$ sudo dnf -y install php yum-utils php-{cli,fpm,mysqlnd,zip,devel,gd,mbstring,curl,xml,pear,bcmath,json,common,intl,opcache,imagick}

Edit the PHP configuration file.

$ sudo nano /etc/php.ini

Find the following lines and change the values like below. Finally, save and close the file.

memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 100M

Restart Apache service.

 $ sudo systemctl restart httpd

Step 2. Create PIMCore Database

Start MySQL service and enable it to start on boot.

$ sudo systemctl start mysqld

$ sudo systemctl enable mysqld

Run mysql_secure installation script to ensure MySQL database server is secure from breaches.

$ sudo mysql_secure_installation

When prompted, answer the questions as shown below:

  • Setup VALIDATE PASSWORD plugin? Press N, then Enter.
  • Remove anonymous users? Press Y, then Enter.
  • Disallow root login remotely? Press Y, then Enter.
  • Remove test database and access to it? Press Y, then Enter.
  • Reload privilege tables now? Press Y, then Enter.

Run MySQL shell login command and enter your password to continue.

$ sudo mysql -u root -p

Create a database named pimcore.

CREATE DATABASE pimcore charset=utf8mb4;

Create a database user pimcoreuser with a password MySecurePassword. Change the value of MySecurePassword to your own secure password.

CREATE USER 'pimcoreuser'@'localhost' IDENTIFIED BY 'MySecurePassword';

Grant the database user full access to the database.

GRANT ALL ON pimcore.* TO 'pimcoreuser'@'localhost' WITH GRANT OPTION;

Save all the changes to take effect.

FLUSH PRIVILEGES;

Exit MySQL shell.

exit;

Step 3. Install PIMCore

Install required dependencies.

$ sudo yum -y install curl git

Install Composer.

$ sudo yum -y install composer

Change to document root.

$ cd /var/www/

Set up the project using composer.

$ sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton pimcore

Change to the installation directory.

$ cd /var/www/pimcore

Run the installer to create an administrator account, and enter your database credentials.

$ sudo ./vendor/bin/pimcore-install

Set the ownership of the directory to the web-root user and group.

$ sudo chown apache:apache -R /var/www/pimcore

Change the access permissions.

$ sudo chcon -R -t httpd_sys_content_rw_t /var/www/pimcore/var

$ sudo chmod -R 777 /var/www/pimcore/var

Step 4. Configure Apache Server

Allow port 80 through the firewall.

$ firewall-cmd --permanent --zone=public --add-port=80/tcp

Reload firewall service.

$ firewall-cmd --reload

Create a new Apache configuration file, pimcore.conf.

$ sudo nano /etc/httpd/conf.d/pimcore.conf

Add the following lines of code to the file. Then, save and close the file.

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/pimcore/public
    ServerName example.com

     <Directory /var/www/pimcore/public/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

    ErrorLog "/var/log/httpd/example.com-error_log"
    CustomLog "/var/log/httpd/example.com-access_log" combined
</VirtualHost>

Restart Apache service for changes to take effect.

$ sudo systemctl restart httpd

Step 5. Access PIMCore Web Platform

To access the PIMCore administrator web platform, go to your browser and visit http://myServerIp/admin/. For example:

http://192.0.2.11/admin/

Conclusion

You have installed PIMCore on your CentOS 8 server. You can now access the administrator portal by logging in with your set credentials.

You can now check the official documentation to learn more on how to use PIMCore.