我已在我的 CentOS 8 VPS 中成功安装了带有 Remi 软件包的 php 7.4(使用本指南https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-使用-apache-and-php-fpm-on-centos-8 )
我的 Apache 服务器中有一个 VirtualHost,它指向我的域并加载该环境所需的 php 版本。
<VirtualHost *:80>
ServerName www.example.net
ServerAlias example.net
DocumentRoot /var/www/example.net/html
ErrorLog /var/www/example.net/log/error.log
CustomLog /var/www/example.net/log/requests.log combined
<IfModule !mod_php7.c>
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/var/opt/remi/php74/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
</IfModule>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
如何使用 Remi 为 php 7.4 安装启用 pdo_sqlsrv 扩展?
我遵循了本指南:https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac ?view=sql-server-ver15#installing-the-drivers-on -red-hat-7-and-8但我认为出了问题。
如果我这样做,<?php echo phpinfo(); ?>我会看到没有加载任何模块https://gyazo.com/d5a30969f06c49e78bf3473a07776492
另外,如果我使用 检查 PHP 版本php -v,则输出如下:
PHP Warning: Module 'sqlsrv' already loaded in Unknown on line 0
PHP Warning: Module …Run Code Online (Sandbox Code Playgroud)