Server Environment Setup for 1C-Bitrix
1C-Bitrix has specific requirements for software versions and configuration: PHP incompatibility with the installed core version, incorrect open_basedir settings, missing mbstring or gd extensions — all of these cause either a white screen or silent degradation of certain functionality. Setting up an environment "for Bitrix" is not simply a matter of installing a LAMP stack.
Stack Requirements
Current recommendations for Bitrix (verify against the system requirements for your version):
| Component | Recommended version | Minimum |
|---|---|---|
| PHP | 8.1–8.2 | 7.4 |
| MySQL/MariaDB | 8.0 / MariaDB 10.6 | MySQL 5.7 |
| Nginx | 1.20+ | 1.18 |
| PHP-FPM | bundled with PHP | — |
| Redis / Memcached | Redis 7 / Memcached 1.6 | — |
Bitrix VM vs. Bare Server
Bitrix Environment (bitrixenv) — the official Bitrix installer for CentOS/Rocky Linux, which sets up the entire stack with configurations optimized for Bitrix:
wget http://repos.1c-bitrix.ru/yum/bitrix-env.sh
chmod +x bitrix-env.sh
./bitrix-env.sh
Pros: automated setup of nginx + apache + php-fpm, ready-made Bitrix configs, built-in bx-manage.sh management script. Cons: tied to CentOS/Rocky, harder to customize.
Ubuntu/Debian (manual setup) — more control, easier to integrate with modern tooling (Docker, Ansible, GitLab CI):
# PHP 8.1 from ppa:ondrej/php
add-apt-repository ppa:ondrej/php
apt install php8.1-fpm php8.1-mysql php8.1-mbstring php8.1-gd \
php8.1-curl php8.1-xml php8.1-zip php8.1-opcache \
php8.1-intl php8.1-soap
Required PHP Extensions for Bitrix
Without these extensions, certain modules will not function:
-
mbstring— Cyrillic text handling -
gdorimagick— image resizing viaCFile::ResizeImage() -
curl— HTTP requests (payments, integrations, SMS) -
soap— 1C integration -
zip— updates via the marketplace -
opcache— critical for performance -
pcre— the component template engine
php.ini Settings for Bitrix
memory_limit = 256M ; minimum 128M; for 1C imports — 512M
max_execution_time = 120 ; standard; for cron jobs — 0
upload_max_filesize = 100M ; file uploads to the media library
post_max_size = 110M
max_input_vars = 10000 ; Bitrix forms with many fields
default_charset = UTF-8
date.timezone = Europe/Moscow
opcache.enable = 1
opcache.memory_consumption = 256
opcache.max_accelerated_files = 20000
opcache.revalidate_freq = 60 ; in production, 300 is acceptable
Directory Permissions
Bitrix requires write access to several directories:
chown -R www-data:www-data /var/www/bitrix
chmod -R 755 /var/www/bitrix
chmod -R 777 /var/www/bitrix/bitrix/cache
chmod -R 777 /var/www/bitrix/upload
chmod -R 777 /var/www/bitrix/bitrix/managed_cache
open_basedir is a frequent source of issues. If enabled, add the Bitrix paths:
open_basedir = /var/www/bitrix:/tmp:/var/log/php
Case Study: Migration to a New Server
A store was migrating from shared hosting (PHP 7.4, MySQL 5.7) to a VPS (PHP 8.1, MySQL 8.0). After the migration: the catalog was not displaying, and the logs showed Notice: Undefined variable and mysql_num_rows(): Argument #1 must be of type mysqli_result. Cause: the outdated template code used the old MySQL API, which is incompatible with PHP 8.
Fix: enable error_reporting = E_ALL in the dev environment, correct the deprecated calls, replace with $result->num_rows. Also set sql_mode = '' in MySQL 8 temporarily for backward compatibility until the refactoring is complete.
Estimated time to set up a Bitrix environment from scratch on a VPS: 1–2 days.

