简体   繁体   English

session_start()失败:权限被拒绝(13)

[英]session_start() failed: Permission denied (13)

OK, I've managed to screw up my permissions while attempting to allow a script to mkdir(). 好的,在设法允许脚本执行mkdir()时,我设法弄清楚了我的权限。 Here's what my permission currently show - could somehow please tell me what they should be in order to get back to normal? 这是我当前允许的内容-能否以某种方式告诉我恢复正常值应该是什么?

XAMPP/: XAMPP /:

drwxr-xr-x   8 root      admin      272 Feb 27  2010 XAMPP

drwxr-xr-x   3 username  admin  102 Feb 27  2010 XAMPP Control.app
lrwxr-xr-x   1 username  admin   18 Oct 26  2010 cgi-bin -> xamppfiles/cgi-bin
lrwxr-xr-x   1 username  admin   14 Oct 26  2010 etc -> xamppfiles/etc
lrwxr-xr-x   1 username  admin   17 Oct 26  2010 htdocs -> xamppfiles/htdocs
lrwxr-xr-x   1 username  admin   15 Oct 26  2010 logs -> xamppfiles/logs
drwxr-xr-x  24 root      admin  816 Feb 26 13:30 xamppfiles

xamppfiles/: xamppfiles /:

drwxr-xr-x  258 root  admin   8772 Feb 27  2010 bin
drwxr-xr-x    4 root  admin    136 Feb 27  2010 cgi-bin
drwxr-xr-x    3 root  admin    102 Feb 27  2010 doc
drwxr-xr-x   23 root  admin    782 Feb 27  2010 error
drwxr-xr-x   24 root  admin    816 Feb 27  2010 etc
drwxr-xr-x+  15 root  admin    510 Feb 26 13:59 htdocs
drwxr-xr-x  160 root  admin   5440 Feb 27  2010 icons
drwxr-xr-x  137 root  admin   4658 Feb 27  2010 lib
drwxr-xr-x    2 root  admin     68 Feb 27  2010 libexec
drwxr-xr-x   33 root  admin   1122 Feb 27  2010 licences
drwxr-xr-x    8 root  admin    272 Feb 26 12:00 logs
drwxr-xr-x   75 root  admin   2550 Feb 27  2010 modules
drwxr-xr-x   99 root  admin   3366 Feb 27  2010 phpmyadmin
drwxr-xr-x    8 root  admin    272 Feb 27  2010 sbin
drwxr-xr-x+   2 root  admin     68 Feb 26 13:30 session
drwxr-xr-x   16 root  admin    544 Feb 27  2010 share
drwxr-xr-x   29 root  admin    986 Feb 27  2010 sql-bench
drwxr-xr-x+   4 root  admin    136 Feb 26 12:51 temp
drwxr-xr-x    3 root  admin    102 Feb 27  2010 var
-rwxr-xr-x    1 root  admin  14339 Feb 27  2010 xampp
-rw-r--r--    1 root  admin   6385 Feb 27  2010 xampp.pot

In htdocs/testsession/: 在htdocs / testsession /中:

drwxr-xr-x+  3 root  admin    102 Feb 26 14:01 testsession

-rw-r--r--@ 1 root  admin  957 Feb 26 14:16 index.php

My testsession/index.php: 我的testsession / index.php:

<?php
// Set the error reporting level
error_reporting(E_ALL);
ini_set("display_errors", 1);
// Start a PHP session
session_start();    
?>

and the errors: 和错误:

/Applications/XAMPP/xamppfiles/session
Warning: session_start() [function.session-start]: open(/Applications/XAMPP/xamppfiles/temp//sess_1b9827985300349847f0169f1031b113, O_RDWR) failed: Permission denied (13) in /Applications/XAMPP/xamppfiles/htdocs/testsession/index.php on line 10

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/testsession/index.php:7) in /Applications/XAMPP/xamppfiles/htdocs/testsession/index.php on line 10

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/testsession/index.php:7) in /Applications/XAMPP/xamppfiles/htdocs/testsession/index.php on line 10

Warning: Unknown: open(/Applications/XAMPP/xamppfiles/temp//sess_1b9827985300349847f0169f1031b113, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/Applications/XAMPP/xamppfiles/temp/) in Unknown on line 0

chmod -R o+w ...../temp甚至更好(更安全) chown -R apache.apache ......./temp (用您的Web服务器使用的用户名/组名替换apache )。

I got this same error message in conjunction with some others. 我与其他一些错误消息相同。 After much grief, the fix was… simply to restart XAMPP. 经过一番痛苦之后,解决方法是……只是重新启动XAMPP。 Hope that helps someone else! 希望对别人有帮助!

Warning: session_start(): open(/var/folders/zw/hdfw48qd25xcch5sz9dd3w600000gn/T/sess_f8bgs41qn3fk6d95s0pfps60n4, O_RDWR) failed: Permission denied (13) in /Applications/XAMPP/xamppfiles/htdocs/foo/bar.php on line 3

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/foo/bar.php:3) in /Applications/XAMPP/xamppfiles/htdocs/foo/bar.php on line 3

Warning: Unknown: open(/var/lib/php/session/sess_isu2r2bqudeosqvpoo8a67oj02, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

chown didn't work for me. chown对我没用。 Instead I has to change the permissions with chmod (of the /Applications/XAMPP/xamppfiles/temp folder sudo chmod 755 seemed to work for me (after chown'ing it) 取而代之的是,我必须使用chmod更改权限(/ Applications / XAMPP / xamppfiles / temp文件夹的sudo chmod 755似乎对我有用(在将其修改后)

I had exact issue in my MAC OS using XAMPP. 我在使用XAMPP的MAC OS中遇到确切问题。

Issue was solved by removing session files from /Application/XAMPP/xampfiles/temp/(whatever the session id is - it will be in error message and you will find file with the same name) 通过从/ Application / XAMPP / xampfiles / temp /中删除会话文件解决了问题(无论会话ID是什么-它将出现错误消息,并且您将找到具有相同名称的文件)

In your case : Applications/XAMPP/xamppfiles/temp/1b9827985300349847f0169f1031b113
so remove file : 1b9827985300349847f0169f1031b113

I figured that issue was caused by moving /renaming some folders in htdocs folder while session was active and seems for mac users that made conflict. 我认为该问题是由于在会话处于活动状态时移动/重新命名htdocs文件夹中的某些文件夹引起的,似乎对造成冲突的Mac用户而言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM