php提示 Warning: touch() [function.touch]: Utime failed: Permission denied in错误
使用timthumb.php出现Warning: touch() [function.touch]: Utime failed: Permission denied in错误
我们先来看一下touch()函数例子
touch() 函数设置指定文件的访问和修改时间。
touch(filename,time,atime)
例子
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy6185')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy6185><?php
touch("test.jpg");
?>
应用例子时出现错误
用timthumb.php来做缩略图,本地测试很OK,但是放到vps上面就出现下面的错误错误提示:
Warning: touch() [function.touch]: Utime failed: Permission denied in /home/wordpress/wp-content/themes/zkeyword/library/timthumb.php on line 199
A TimThumb error has occured
The following error(s) occured:
Could note create the index.html file - to fix this create an empty file named index.html file in the cache directory.
从字面上理解,是创建缓存的cache文件没有权限,我就直接将cache的权限设为0777,但是还是不行,还是提示权限不足,进入cache目录后还有一个index.html文件,将其设为0777,问题就解决了。
您可能感兴趣的文章:
php提示 Warning: touch() [function.touch]: Utime failed: Permission denied in错误
php include提示failed to open stream: Permission denied in错误
php报错Permission denied的解决一法
PHP Warning: file_get_contents failed to open stream解决办法
开启PHP的error_log排查线上遇到的错误
php file_get_contents抓取https地址报错的解决办法
php使用session提示[function.session-start]: open解决方法
phpmyamdin安装出现Warning: require(./libraries/Error_Handler.class.php) 错误解决办法
startOSW.sh: ./OSWatcher.sh: /bin/ksh: bad interpreter: Permission denied的解决方法
分析PHP错误处理(核心特性)