[英]Azure - “PHP Warning: session_start(): Cannot find save handler 'wincache'” after already being loaded
I've got a webjob running on my Azure app service that starts off with the session_start();
我在Azure应用程序服务上运行了一个webjob,该webjob以
session_start();
command. 命令。
At first - I was getting this error: 一开始-我遇到了这个错误:
PHP Warning: session_start(): Cannot find save handler 'wincache' - session startup failed in D:\\local\\Temp\\jobs\\triggered\\myCron\\a4ypumbv.4i2\\MyCron\\myCron.php on line 3
PHP警告:session_start():找不到保存处理程序'wincache'-会话启动在第3行的D:\\ local \\ Temp \\ jobs \\ triggered \\ myCron \\ a4ypumbv.4i2 \\ MyCron \\ myCron.php中失败
What I ended up doing was going to my App Service -> Application Settings, and I set a custom setting of PHP_INI_SCAN_DIR
set to D:\\home\\site
, like so: 我最终要做的是转到我的应用程序服务->应用程序设置,然后将
PHP_INI_SCAN_DIR
的自定义设置设置为D:\\home\\site
,如下所示:
Then, inside the D:\\home\\site
directory, I uploaded a file titled phpconfig.ini
, and inside I placed this: 然后,在
D:\\home\\site
目录中,我上传了一个名为phpconfig.ini
的文件,并将其放置在其中:
extension=D:\home\site\ext\php_wincache.dll
I went to https://www.iis.net/downloads/microsoft/wincache-extension and downloaded the appropriate WinCache version - WinCache 1.3 for PHP 5.6
from SourceForge. 我转到https://www.iis.net/downloads/microsoft/wincache-extension,并从SourceForge下载了相应的WinCache版本-
WinCache 1.3 for PHP 5.6
。 After unpacking the .exe
file, I copied the php_wincache.dll
file into my D:\\home\\site\\ext
folder. 解压缩
.exe
文件后,我将php_wincache.dll
文件复制到了D:\\home\\site\\ext
文件夹中。
Now, when I run the webjob, I get this same error but also another error message right before it saying the wincache
file was already loaded: 现在,当我运行webjob时,我得到了相同的错误,但是在显示
wincache
文件已经加载之前,又出现了另一条错误消息:
PHP Warning: Module 'wincache' already loaded in Unknown on line 0
PHP警告:模块'wincache'已在第0行的Unknown中加载
PHP Warning: session_start(): Cannot find save handler 'wincache' - session startup failed in D:\\local\\Temp\\jobs\\triggered\\myCron\\a4ypumbv.4i2\\MyCron\\myCron.php on line 3
PHP警告:session_start():找不到保存处理程序'wincache'-会话启动在第3行的D:\\ local \\ Temp \\ jobs \\ triggered \\ myCron \\ a4ypumbv.4i2 \\ MyCron \\ myCron.php中失败
How can I make these warnings go away completely? 如何使这些警告完全消失? Has anyone run into the same problem before?
有人遇到过同样的问题吗?
wincache
has been already installed and enabled in Azure App Service. 已在Azure App Service中安装并启用
wincache
。
In this case, you no longer need to call session_start()
manually, Azure would start sessions on each page automatically. 在这种情况下,您不再需要手动调用
session_start()
,Azure会自动在每个页面上启动会话。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.