如何使缓存目录可写

如何使缓存目录可写

本文介绍了如何使缓存目录可写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我一个简单的问题,但是您如何使它可写?

Forgive me for my simple question but how do you make it writable?

我阅读了它,例如,需要将其更改为:timthumbs或 http://shiftingpixel.com/2008/03/03/smart-image-resizer/

I read it it needs to be change to for example: for timthumbs or http://shiftingpixel.com/2008/03/03/smart-image-resizer/

使图像缓存目录可由Web服务器写入(通常为chmod 775)"

"Make your imagecache directory is writable by the web server (usually chmod 775)"

那么我只是调用函数还是什么?

So I just call the function or what?

推荐答案

通常,在没有认真思考的情况下chmod 755目录是个坏主意.在您的Web服务器上,将有一个Web服务器软件运行的用户,通常是www-dataapache之类的用户.您可以chown -R apache /path/to/your/cache/dir,这样PHP可以写入该目录.

Usually, it's a bad idea to chmod 755 directories without some serious forethought. On your webserver, there will be a user that the web server software runs as, usually something like www-data or apache. You can chown -R apache /path/to/your/cache/dir and that way PHP can write to that directory.

为澄清起见,这些是您将从Web服务器上的Shell运行的命令,例如通过SSH.它们不是PHP函数.您的虚拟主机应具有有关如何获取外壳程序访问权限的更多信息.

To clarify, these are commands you would run from a shell on your webserver, such as via SSH. They are not PHP functions. Your web host should have more information about how you can get shell access.

这篇关于如何使缓存目录可写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 10:28