.htaccess切换至PHP8.2失效问题排查
问题:.htaccess切换PHP版本失败,需为不同子域名配置对应PHP版本
我尝试通过修改.htaccess将PHP版本从7.4切换至8.2,配置内容如下:
DirectoryIndex index.php AddHandler application/x-httpd-php82 .php <IfModule mod_negotiation.c> Options -MultiViews </IfModule>
但操作未成功。执行sudo update-alternatives --config php的输出如图所示,.htaccess与info.php存于同一目录,info.php显示仍未使用PHP8.2。
我的需求是针对不同子域名切换PHP版本,当前Vhost配置片段如下:
<Directory /var/www/testshop.leitner-sales.at> Options -Indexes +FollowSymLinks +MultiViews AllowOverride All Order allow,deny allow from all </Directory>
内容的提问来源于stack exchange,提问作者user24710148
相关产品推荐
相关产品推荐

