本文介绍了PHP 警告权限在 session_start() 上被拒绝 (13)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
如何修复权限错误我调用 session_start()?

我收到以下错误:

PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: open(/tmp/sess_49a20cbe1ef09a2d0262b3f7eb842e7b, O_RDWR) failed: Permission denied (13) in /home/------/public_html/includes/libs/ss.inc.php on line 1

问题不会一直发生,而是来来去去.

The problem doesn't happen all the time, but comes and goes.

这是 ss.inc.php 中第 1 行的代码

This the code at line on 1 in ss.inc.php

<?php session_start(); ?>

推荐答案

您似乎没有对服务器上的 /tmp 目录的写权限.这有点奇怪,但你可以解决它.调用 session_start() 之前,调用 session_save_path() 并为其指定服务器可写的目录的名称.详情在此处.

You don't appear to have write permission to the /tmp directory on your server. This is a bit weird, but you can work around it. Before the call to session_start() put in a call to session_save_path() and give it the name of a directory writable by the server. Details are here.

这篇关于PHP 警告权限在 session_start() 上被拒绝 (13)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 20:58