douwen5066 2015-10-30 15:26
浏览 56
已采纳

PHP会话不适用于IIS 7.5

I have an IIS server with multiple virtual hosts running from the default site, these host all use PHP and create login sessions daily.

I recently added a new site (new domain) in IIS and the virtual directories I put in this site cant't create PHP sessions. I tried the following basic test which works in the default website.

session_start();
$_SESSION['test'] = 'my_test_value';
echo $_SESSION['test'];

So I load the page to store the session value then comment out the second line and load again and I get..

PHP Notice:  Undefined index: test 

Have I configured the site incorrectly or do I need to enable something in PHP, like I said the default site has not problems creating sessions, and this is the first time I have added a second site to IIS so I am a bit of a newbie.

  • 写回答

2条回答 默认 最新

  • donglv6960 2015-11-02 11:57
    关注

    I resolved this by installing an instance of PHP 5.6 and pointing the new site to the new instance of PHP and leaving the old site pointing to 5.3

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 qgcomp混合物线性模型分析的代码出现错误:Model aliasing occurred
  • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥15 小红薯封设备能解决的来
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答
  • ¥20 在本地部署CHATRWKV时遇到了AttributeError: 'str' object has no attribute 'requires_grad'
  • ¥15 vue+element项目中多tag时,切换Tab时iframe套第三方html页面需要实现不刷新