安装Roundcube使用Apache2但出现错误,不支持的PHP版本,需要>=7.3

huangapple go评论62阅读模式
英文:

Installing Roundcube using Apache2 but error unsupported PHP version, required >=7.3

问题

我在我的服务器上使用Roundcube 1.6.1遇到了问题。我认为我的服务器上的一些现有配置可能会干扰Roundcube,但我不确定。到目前为止,这是我的设置:

  1. 我在我的服务器上安装了Odoo,它位于Python3虚拟环境中,托管在主域上。
  2. Odoo在Apache2 Web服务器上运行,端口为8069(默认),并从其虚拟主机配置进行反向代理,因此可以通过端口80/443访问。

我已经下载了Roundcube并安装了以下PHP扩展:

sudo apt install php-net-ldap2 php-net-ldap3 php-imagick php8.1-common php8.1-gd php8.1-imap php8.1-mysql php8.1-curl php8.1-zip php8.1-xml php8.1-mbstring php8.1-bz2 php8.1-intl php8.1-gmp php8.1-redis

我还为Roundcube配置了一个Apache2虚拟主机:

<VirtualHost *:80>
  ServerName mail.MyDomain.com
  DocumentRoot /var/www/roundcube/

  ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
  CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  <Directory /var/www/roundcube/>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>

然而,当我访问mail.MyDomain.com时,我收到以下错误消息:“不支持的PHP版本。要求PHP >= 7.3。”子域有效,Roundcube的favicon也出现了,这意味着域配置正确,Apache2从正确的目录读取。因此,这个错误暗示了与我的Apache2 PHP版本有关的问题。

我尝试安装libapache-mod-php8.1并启用它。然而,在重新加载我的网站后,邮件子域和Odoo主域都崩溃了,所以我不得不禁用它并重新加载(sudo a2dismod)。

我应该如何配置Roundcube以使其与mail.MyDomain.com一起工作?任何建议都将不胜感激,谢谢。

英文:

I am having trouble getting Roundcube 1.6.1 to work on my server. I believe some pre-existing configuration on my server may interfere with Roundcube but I am unsure. Here is what I have set up so far:

  1. I have Odoo installed on my server within a Python3 virtual environment hosted on the primary domain.
  2. Odoo is running on Apache2 web server on port 8069 (default) and is reverse proxied from its virtual host configuration so it is accessible on ports 80/443.

I have downloaded Roundcube and installed the following PHP extensions:

sudo apt install php-net-ldap2 php-net-ldap3 php-imagick php8.1-common php8.1-gd php8.1-imap php8.1-mysql php8.1-curl php8.1-zip php8.1-xml php8.1-mbstring php8.1-bz2 php8.1-intl php8.1-gmp php8.1-redis

I have also configured an Apache2 Virtual Host for Roundcube:

&lt;VirtualHost *:80&gt;
  ServerName mail.MyDomain.com
  DocumentRoot /var/www/roundcube/

  ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
  CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined

  &lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride All
  &lt;/Directory&gt;

  &lt;Directory /var/www/roundcube/&gt;
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  &lt;/Directory&gt;

&lt;/VirtualHost&gt;

However, when I visit mail.MyDomain.com, I receive the following error message: "Unsupported PHP version. Required PHP >= 7.3." The subdomain works and the Roundcube favicon appears, which means the domain configuration is correct and Apache2 is reading from the correct directory. Therefore this error implies an issue with my Apache2 PHP version.

I tried installing libapache-mod-php8.1 and enabling it. However, upon reloading my website, both the mail subdomain and the Odoo primary domain broke, so I had to disable it and reload again (sudo a2dismod).

How should I configure Roundcube to work with mail.MyDomain.com? Any advice is appreciated, thanks

答案1

得分: 0

我解决了。答案是一个错误配置的Roundcube config.php文件。
在Roundcube配置文件中,有一个数据库链接

$config['db_dsnw'] = 'mysql://roundcube:MyPassword/roundcubemail';

我检查了它缺少了@localhost。应该是这样的:

$config['db_dsnw'] = 'mysql://roundcube:MyPassword@localhost/roundcubemail';

在这之后,Roundcube网站加载了,我可以测试登录。

英文:

I solved it. The answer is a misconfigured Roundcube config.php file.
In the Roundcube config file, there was a database link

$config[&#39;db_dsnw&#39;] = &#39;mysql://roundcube:MyPassword/roundcubemail&#39;;

I checked it's missing @localhost. It should have been like this:

$config[&#39;db_dsnw&#39;] = &#39;mysql://roundcube:MyPassword@localhost/roundcubemail&#39;;

After this, the Roundcube website loads, and I can test logging in

huangapple
  • 本文由 发表于 2023年6月16日 10:57:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76486691.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定