Roundcube showing php source code

I’m having troubles with roundcube webmail. After changing system php version from 7.4 to 8.0 and moving from roundcube using apt to /var/lib/roundcube the browser is showing the php source code (both http and https). My server uses apache2, nginx as proxy, php-fpm and hestia v1.6.13 on Ubuntu 20.04. I cant’t find any errors in apache logfiles. I seems php is not enabled for the webmail configuration.
The apache2 config file for my webmail is the following:

<VirtualHost x.x.x.x:8443>
    ServerName webmail.**.tld
    ServerAlias mail.**.tld
    Alias / /var/lib/roundcube/
    Alias /error/ /home/**/web/**.tld/document_errors/
    #SuexecUserGroup ** **

    SSLEngine on
    SSLVerifyClient none
    SSLCertificateFile         /home/**/conf/mail/**.tld/ssl/**.tld.crt
    SSLCertificateKeyFile      /home/**/conf/mail/**.tld/ssl/**.tld.key

    <Directory "/usr/share/tinymce/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
    </Directory>

    <Directory /var/lib/roundcube/>
        Options +FollowSymLinks
        # This is needed to parse /var/lib/roundcube/.htaccess. See its
        # content before setting AllowOverride to None.
        AllowOverride All
        order allow,deny
        allow from all
    </Directory>

    # Protecting basic directories:
    <Directory /var/lib/roundcube/config>
            Options -FollowSymLinks
            AllowOverride None
    </Directory>

    <Directory /var/lib/roundcube/temp>
            Options -FollowSymLinks
            AllowOverride None
        Order allow,deny
        Deny from all
    </Directory>

    <Directory /var/lib/roundcube/logs>
            Options -FollowSymLinks
            AllowOverride None
        Order allow,deny
        Deny from all
    </Directory>

    IncludeOptional /home/**/conf/mail/**.tld/apache2.ssl.conf_*
</VirtualHost>

After working into the Apache configuration, I found the problem. The apache module mpm_prefork module was enabled, but the configuration file /etc/apache2/conf.d/hestia-event.conf, which handled the php-files, was configured for mpm_event_module:

<IfModule mpm_event_module>
    <FilesMatch \.php$>
        SetHandler "proxy:fcgi://127.0.0.1:9000"
    </FilesMatch>
</IfModule>

I just disabled mpm_prefork and enalbed mpm_event. Everything find now.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.