在Apache配置文件中,可以使用以下代码示例来解决PHP会话在唯一的Vhost用户中不起作用的问题:
httpd.conf
)。
ServerName example.com
DocumentRoot /path/to/your/vhost/directory
# 其他配置项...
ServerName example.com
DocumentRoot /path/to/your/vhost/directory
# 启用PHP会话
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
# 添加以下代码来启用PHP会话
php_flag session.auto_start on
# 其他配置项...
通过在唯一的Vhost用户的配置部分中添加php_flag session.auto_start on
,可以启用PHP会话,并确保会话在该Vhost中起作用。
重启Apache服务器后,PHP会话应该能够在唯一的Vhost用户中正常工作了。
上一篇:Apache未显示正确的文件。
下一篇:Apache未正确重写URL