Mac下运行PHP提示session_start():Session data file is not created by your uid

Mac下运行PHP提示session_start():Session data file is not created by your uid

错误提示

session_start():Session data file is not created by your uid
详细错误如下图

Mac下运行PHP提示session_start():Session data file is not created by your uid_第1张图片

我的环境是Mac+MAMP+PHP7+MYSQL5.6
使用的是TP5进行开发.
本来在公司运行项目是正常的,拿回家运行就这样了!因为刚学习PHP不久,自己研究了一下,以下给出我的解决办法!

删除Session文件即可!

如果使用MAMP作为集成环境的话,路径应该和我一样,我这里说一下查看Session路径的方法。
在浏览器打开http://localhost:8888/MAMP/.如果改了端口就将后面端口改一下

Mac下运行PHP提示session_start():Session data file is not created by your uid_第2张图片

如图点击phpinfo.
cmd+f搜索 session.save_path,如图
Mac下运行PHP提示session_start():Session data file is not created by your uid_第3张图片

然后进入对应目录将其文件删除即可!
Mac下运行PHP提示session_start():Session data file is not created by your uid_第4张图片

然后重新刷新项目,成功运行!

你可能感兴趣的:(Mac下运行PHP提示session_start():Session data file is not created by your uid)