Testing Horde 6 in Windows WSL Ubuntu

Install a recent ubuntu/apache/mod-php setup into your local Windows WSL to get going.
(This is a dump – It will involve into an article someday)

Assuming you have installed WSL2 for Windows 10 or Windows 11

This is Ubuntu for WSL in the MS Store: Ubuntu – Microsoft Apps
Install via CLI or Store UI
Run Ubuntu in WSL:
wsl -d Ubuntu

Now Upgrade, add the php repo, install some software

apt update ; apt dist-upgrade
sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/nginx
apt install php8.2 php8.2-fpm php8.2-curl php8.2-dom composer gh php8.2-mbstring php8.2-sockets nginx

Add nginx config for passing php-fpm and for recognizing .php

File: /etc/nginx/sites-available/base.php82.horde

server {
        listen 80;
        root /var/www/base.php82.horde/web;
        index index.php index.html index.htm;
        server_name base.php82.horde;
        location / {
                try_files $uri $uri/ =404;
        }
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php8.2-fpm.sock;
        }
}

Run these commands to activate PHP for our horde testing environment:

cp -ar /var/www/base.php82.horde/vendor/horde/horde/config/conf.php.dist /var/www/base.php82.horde/var/config/horde/conf.php
cd /var/www/base.php82.horde/

Open your Windows Notepad in “Administrator” mode and edit file C:\Windows\System32\Drivers\Etc\Hosts

Add new lines at the bottom and save

127.0.0.1 base.php82.horde
127.0.0.1 components.php82.horde

By now you can enter into your browser: http://base.php82.horde and get to a message saying
Please create a /var/www/base.php82.horde/var/config/horde/conf.php file and then run ‘composer horde-reconfigure’ to activate Horde

Starting with a default horde config

Start with a default horde config

cp -ar /var/www/base.php82.horde/vendor/horde/horde/config/conf.php.dist /var/www/base.php82.horde/var/config/horde/conf.php
cd /var/www/base.php82.horde/
composer horde-reconfigure

Leave a Reply

Your email address will not be published. Required fields are marked *