session_start()在Mac上不起作用 [英] session_start() not working on mac

查看:190
本文介绍了session_start()在Mac上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何解决以下情况下的权限错误我叫session_start()?
session_start()上的PHP警告许可被拒绝(13)

Possible Duplicate:
How can I fix the Permission error when I call session_start()?
PHP Warning Permission denied (13) on session_start()

我正在尝试创建一个管理面板.不幸的是,会话在Macbook上不起作用. 我已经安装并正常工作了,这时也安装了最新的php.

I am trying to make an admin panel. Unfortunately session does not work on macbook. I have everything installed and working, also latest php at this time.

我只是无法在Mac上运行它.它可以在我的付费主机上正常工作,但是我不能在那上工作.

I just cannot manage to get it working on my mac. It does work on my paid hosting however I cannot work on that.

请帮助我解决此问题.我相信这与许可编写有关.

Please help me to resolve this issue. I believe it's something about permission writing or so.

推荐答案

您需要更改以下权限:

/var/folders

我建议更改文件夹的所有权:

I would suggest changing the ownership of the folder:

sudo chown -R nobody /var/lib/php/session
sudo chgrp -R nobody /var/lib/php/session

"nobody"选项是您的网络服务器运行的用户,第二个命令是组.

The 'nobody' option being the user that your webserver runs under and for the second command it's the group.

注意:将该文件夹更改为您将session.save_path设置为的位置.在上面的问题中,文件夹为/var/folders,因此代码为chown -R nobody /var/folders

Note: The folder would need to be changed to wherever you have set your session.save_path to. In the question above the folder is /var/folders so the code would be chown -R nobody /var/folders

这篇关于session_start()在Mac上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆