Introduction
PIMCore is an open-source, web-based digital content management platform. It's used by enterprise businesses for Product Information Management (PIM), Master Data Management (MDM), Digital Asset Management (DAM), Digital Commerce Platform, and Content Management System. It's fast, flexible, and user-friendly with custom plugins for advanced functionality. This article explains how to install PIMCore on FreeBSD 13.0 server.
Prerequisites
Perform the following steps first:
- Deploy a Rcs FreeBSD 13.0 Server.
- SSH into the server you deployed.
- Create a non-root user with sudo access.
Step 1. Install Required Packages
Update the system package list.
$ pkg updateInstall required packages.
$ pkg install -y sudo nano unzip wget bashInstall PHP 8.0, Apache, MySQL, and more modules.
$ sudo pkg install -y apache24 mysql80-server mod_php80 php80 php80-session php80-curl php80-xml php80-zip php80-mbstring php80-ctype php80-imap php80-simplexml php80-tokenizer php80-xmlreader php80-xmlwriter php80-pear php80-fileinfo php80-phar php80-exif php80-iconv php80-mysqli php80-pdo_mysql php80-dom php80-filter php80-intl php80-openssl php80-intl php80-opcache php80-gdEnable PHP-FPM service.
$ sudo sysrc php_fpm_enable=yesStart PHP-FPM service.
$ sudo service php-fpm startCopy the sample PHP configuration file.
$ sudo cp /usr/local/etc/php.ini-production /usr/local/etc/php.iniStep 2. Create PIMCore Database
Enable MySQL service to start on system boot.
$ sudo sysrc mysql_enable="yes"Start MySQL service.
$ sudo service mysql-server startLog in to MySQL shell. On password prompt, just press Enter to continue.
$ sudo mysql -u root -pSecure the MySQL root user by changing the password. Change the value of StrongPassword with your own secure password.
ALTER USER 'root'@'localhost' IDENTIFIED BY 'StrongPassword';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 WITH mysql_native_password 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 pkg install -y curl gitDownload Composer installer.
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"Verify the installer.
$ php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"Run the installer.
$ php composer-setup.phpRemove the installer.
$ php -r "unlink('composer-setup.php');"Make Composer global by moving composer.phar to the system path.
$ sudo mv composer.phar /usr/local/bin/composerVerify Composer version.
$ composer -VChange to document root.
$ cd /usr/local/www/apache24/data/Set up the project using composer.
$ sudo COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton pimcoreChange to the installation directory.
$ cd /usr/local/www/apache24/data/pimcoreRun the installer to create an administrator account, and enter your database credentials.
$ sudo ./vendor/bin/pimcore-installSet the ownership of the directory to the web-root user and group.
$ sudo chown -R www:www /usr/local/www/apache24/data/pimcore/Change the access permissions.
$ sudo chmod -R 755 /usr/local/www/apache24/data/pimcore/Step 4. Configure Apache2
Enable Apache service to start on system boot.
$ sudo sysrc apache24_enable=yesStart Apache service.
$ sudo service apache24 startCreate a configuration file to allow Apache to work with PHP.
$ sudo nano /usr/local/etc/apache24/modules.d/001_mod-php.confAdd the following lines of code to the file. Save and close the file.
<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>Create Apache configuration file pimcore.conf for PIMCore.
$ sudo nano /usr/local/etc/apache24/Includes/pimcore.confAdd the bellow code to the file. Save and close the file.
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /usr/local/www/apache24/data/pimcore/public
ServerName example.com
<Directory /usr/local/www/apache24/data/pimcore/public/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>Test the configuration.
$ sudo apachectl configtestEnable mod_rewrite by editing the apache configuration file.
$ sudo nano /usr/local/etc/apache24/httpd.confUncomment the following line. Save and close the file:
LoadModule rewrite_module libexec/apache24/mod_rewrite.soRestart Apache service.
$ sudo service apache24 restartStep 5. Access PIMCore
To access the PIMCore Web Interface, go to your browser and visit http://Server_IP/admin/. For example:
http://192.0.2.10/admin/Conclusion
You have installed PIMCore on your FreeBSD 13.0 server. You can now check the official documentation to learn more on how to use PIMCore.