I have installed MantisBT in Ubuntu in wsl2, I had no problem following the instructions like in another ubuntu server (unless for enabling ufw), but at the moment of open the browser to proceed with the installation I just see the contents of the file index.php. index.php in Browser
I'd try to search information about installing mantisBT in wsl without success, so that is why I come here to ask if anyone had successfully installed MantisBT in Ubuntu in Wsl or you have any clues to try to resolve this.
This is my apache confid file,
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/mantis"
ServerName localhost
ServerAlias localhost
ErrorLog "/var/log/apache2/mantis-error_log"
CustomLog "/var/log/apache2/mantis-access_log" combined
<Directory "/var/www/html/mantis/">
DirectoryIndex index.php index.html
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
It was due to a missing php package, so first make sure you have all the packages require, I found this thanks to the mantis-error_log file, In my case was php-fpm. but just installing it does not do the trick, yo have to install it, start the service and restart apache2
sudo apt install php7.x-fpm
sudo service php7.x-fpm start
sudo service apache2 restart
One thing I may have forgot also, was to change the permissions of the mantis folder
sudo chmod -R 755 /var/www/html/mantis
and finally I made some changes in th conf file and system32/drivers/host to make it work at its own URL. This was just improvemnt, not really part of th problem.
<VirtualHost *:80>
ServerAdmin webmaster@yourdomain.com
DocumentRoot "/var/www/html/mantis"
ServerName mantis.test
ServerAlias www.mantis.test
ErrorLog "/var/log/apache2/mantis-error_log"
CustomLog "/var/log/apache2/mantis-access_log" combined
<Directory "/var/www/html/mantis/">
DirectoryIndex index.php index.html
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
system32/drivers/etc/hosts
127.0.0.1 mantis.test
::1 mantis.test