Minimum server and PHP requirements
Running Magento 2 requires specific server configurations. Using unsupported PHP versions or missing extensions causes errors and security vulnerabilities. This guide covers the requirements for current Magento versions.
Quick Reference Table
| Magento Version | PHP Versions | MySQL | MariaDB | Elasticsearch/OpenSearch |
|---|---|---|---|---|
| 2.4.7 | 8.2, 8.3 | 8.0 | 10.6 | ES 8.x / OS 2.x |
| 2.4.6 | 8.1, 8.2 | 8.0 | 10.6 | ES 7.17, 8.x / OS 2.x |
| 2.4.5 | 8.1 | 8.0 | 10.4 | ES 7.17 / OS 1.2 |
| 2.4.4 | 8.1 | 8.0 | 10.4 | ES 7.16 / OS 1.2 |
PHP Requirements
PHP Version
Always use a supported PHP version for your Magento release. Running on unsupported versions:
- Causes fatal errors and broken functionality
- Creates security vulnerabilities
- Voids support eligibility
Required PHP Extensions
These extensions must be installed and enabled:
bcmath
ctype
curl
dom
fileinfo
filter
gd
hash
iconv
intl
json
libxml
mbstring
openssl
pcre
pdo_mysql
simplexml
soap
sockets
sodium
spl
tokenizer
xmlwriter
xsl
zip
zlib
Check installed extensions:
php -m
PHP Settings
Recommended php.ini settings:
memory_limit = 2G
max_execution_time = 18000
max_input_vars = 10000
post_max_size = 64M
upload_max_filesize = 64M
realpath_cache_size = 10M
realpath_cache_ttl = 7200
opcache.enable = 1
opcache.memory_consumption = 512
opcache.max_accelerated_files = 60000
opcache.validate_timestamps = 0
Note: Set opcache.validate_timestamps = 1 in development for file change detection.
Database Requirements
MySQL
- MySQL 8.0 is required for Magento 2.4.x
- Use InnoDB storage engine
- Enable
innodb_large_prefix(default in MySQL 8.0)
MariaDB
- MariaDB 10.4+ for Magento 2.4.4-2.4.5
- MariaDB 10.6 for Magento 2.4.6+
Database Settings
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
max_allowed_packet = 64M
tmp_table_size = 64M
max_heap_table_size = 64M
Search Engine Requirements
Magento 2.4+ requires Elasticsearch or OpenSearch. MySQL search is no longer supported.
Elasticsearch
- Version 7.17 or 8.x depending on Magento version
- Java 11 or higher required
OpenSearch
- OpenSearch 1.2 or 2.x depending on Magento version
- Compatible alternative to Elasticsearch
Verify Elasticsearch is running:
curl -X GET "localhost:9200"
Web Server Requirements
Nginx (Recommended)
- Nginx 1.x
- PHP-FPM configured
- Sample config included in Magento at
nginx.conf.sample
Apache
- Apache 2.4
mod_rewriteenabledAllowOverride Allfor Magento directory
Composer
- Composer 2.x required for Magento 2.4+
- Composer 1.x no longer supported
Check version:
composer --version
Additional Requirements
Redis (Recommended)
- Redis 6.x or 7.x for caching and sessions
- Significantly improves performance
Varnish (Optional)
- Varnish 7.x for full-page caching
- Recommended for high-traffic stores
RabbitMQ (Optional)
- RabbitMQ 3.11+ for message queues
- Required for B2B and some async operations
Checking Your Setup
Magento includes a readiness check:
bin/magento setup:config:set --help
Or check PHP requirements:
php -r "echo 'PHP Version: ' . PHP_VERSION . PHP_EOL;"
php -m | sort
Cloud Environments
Adobe Commerce Cloud and managed hosting providers handle most requirements automatically. Verify with your provider if you're unsure about specific versions.
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team