创建新的tmp文件夹供PHP使用? [英] Creating new tmp folder for PHP to use?

查看:110
本文介绍了创建新的tmp文件夹供PHP使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为我在使用PHP会话时遇到问题,因为我在同一台服务器上安装了cPanel,并且我相信它具有附加的安全性,可以防止对/tmp的写访问

I think I'm having problems using PHP sessions because I've got cPanel installed on the same server and I believe it has additional security in place that prevents write access to /tmp

我可以设置一个新文件夹,但是不确定该文件夹应具有哪些权限/所有者.

I can set a new folder, but am unsure what permissions / owners should this folder have.

还要理想地放置在哪里?

Also where should it ideally be located?

推荐答案

兄弟们.
您正在从错误的一端提取此日志.猜测永远不会帮助您.

Look, bro.
You are pulling this log from the wrong end. Guessing will never help you.

有一件事叫做错误消息.
而且,您迫切需要与之取得联系.
它会告诉您会话无法正常工作的所有原因.

There is a thing called error message.
And you desperately need to get in touch with it.
It will tell you everything of the reasons why your sessions doesn't work.

如果这确实是/tmp问题,则PHP在这种情况下会收到一条特殊的错误消息:

If it's really a /tmp problem, PHP got a special error message for tis case:

警告:无法写入会话数据(文件).请验证session.save_path的当前设置正确(/tmp))

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp))

如果收到此消息,则可以确定这是会话无法进行的原因,您可以开始对其进行修复.

If you get this message, you can be certain that it's the reason for your sessions doesn't work and you can start to repair it.

对于错误的会话处理程序,它还会显示一条错误消息.以及其他所有问题.

It has an error message for the wrong session handler as well. As well for the every other problem.

因此,您必须首先获取错误消息.然后阅读并让您知道您遇到的某些问题.轻松自在.

So, you have to get error message first. Then read it nd it makes you know, what certain problem you have. Easy-peasy.

作为一种快速的解决方法,您可以使用此代码在屏幕上显示错误消息

As a quick workaround you can use this code to bring error messages on the screen

error_reporting(E_ALL);
ini_set('display_errors',1);

但仅用于调试这种情况,然后将其删除.错误消息不应在生产服务器的屏幕上输出.
因此,学习阅读错误日志.我确定您的服务器将所有错误消息都放入了error_log中.只需找到它并查找PHP错误即可.

but only to debug this situation and then remove it. Error messages shouldn't be output on the screen a production server.
So, learn to read error logs. I am sure your server put all errors messages into error_log. Just find it and look for PHP errors.

这篇关于创建新的tmp文件夹供PHP使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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