If you find my work valuable, please consider sponsoring |
devenv it's a powerful development environment based on NixOS.
It allows you to have containerized environments without containers or hypervisor or emulation, with native performance on any platform.
This is by far the fasted Magento/Openmage development environment I've ever worked with and it's more than worth of the time to learn it.
This repo has a basic (and yet complete) OpenMage project installed via composer and all of the necessary software stack:
- PHP 8.2 (managed by PHP-FPM and served by Caddy)
- MySQL 8.0
- redis 7.0
- Xdebug 3.2
- MailHog for email testing
- n98-magerun
- If you don't have devenv/NixOS installed please follow devenv's installation guide, it's actually pretty easy and straightforward.
- Then clone this repository to have all the configuration files on your machine
- Enter the cloned repo's directory
- run
devenv up
, this will start all the software stack (and also run composer install for you)
At the moment the project is configured with http://openmage.test
as the main domain name (you can change it in the devenv.nix
file) and you don't even have to add it to your hosts file manually since it's automatically managed through hostctl. You'll just have to open your browser to http://openmage.test
and continue the installation through the web installer.
When asked for MySQL host/user/password type 127.0.0.1
, openmage
and openmage
(you can change the default username/password editing your devenv.nix
file).
redis runs on port 6379, you can enable OpenMage support for it in the usual way, eg:
<cache>
<backend>Mage_Cache_Backend_Redis</backend>
<backend_options>
<server>127.0.0.1</server>
<port>6379</port>
<persistent><![CDATA[cache-db0]]></persistent>
<database>0</database>
<password></password>
<force_standalone>0</force_standalone> <!-- 0 for phpredis, 1 for standalone php -->
<connect_retries>1</connect_retries>
<read_timeout>10</read_timeout>
<automatic_cleaning_factor>0</automatic_cleaning_factor>
<compress_data>1</compress_data>
<compress_tags>1</compress_tags>
<compress_threshold>204800</compress_threshold>
<compression_lib>gzip</compression_lib>
</backend_options>
</cache>
MailHog is chatching all the emails, but:
- you'll have to install
aschroder/smtp_pro
or any other SMTP module for OpenMage (SMTP runs on port1025
) - to read the emails and verify what's been sent access the MailHog web interface at
http://127.0.0.1:8025
At the moment this project doesn't have a composer.lock
file in the repo, because it differ based on the PHP version, this makes it a bit easier to change PHP version if you need to. Anyway I think it's a minor detail and may change in the future.