经过一段时间的尝试调试失败后move_uploaded_file
打电话,我试过了
strace -s 8192 -o strace.log -f /etc/init.d/apache22 restart
在更多的输出中,这产生了以下几行:
5069 lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
5069 lstat64("/var/apache22", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
5069 lstat64("/var/apache22/var", 0xbffe0f8c) = -1 ENOENT (No such file or directory)
(是的,我知道路径有点奇怪。它是一个遗留应用程序。)
问题是“/var/apache22/var”确实存在。从根会话逐字粘贴([括号内的文本] 除外):
# ls -la "/var/apache22/var"
total 24
drwxr-xr-x 6 root root 4096 Mar 7 2011 .
drwxr-xr-x 9 root root 4096 Jan 11 19:18 ..
drwxr-xr-x 10 root root 4096 Mar 7 2011 apache22
drwxr-xr-x 3 root root 4096 Mar 7 2011 log
drwxr-xr-x 2 root root 4096 Jan 11 19:36 run
drwxr-xr-x 3 root root 4096 Mar 7 2011 usr
# stat "/var/apache22/var"
File: `/var/apache22/var'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 804h/2052d Inode: 539214 Links: 6
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2012-01-11 19:46:47.000000000 +0100
Modify: 2011-03-07 23:27:57.000000000 +0100
Change: 2011-06-06 19:39:40.000000000 +0200
# mount
/dev/sda1 on / type ext3 (rw)
/dev/sda3 on /usr type ext3 (rw)
/dev/sda4 on /var type ext3 (rw)
sysfs on /sys type sysfs (rw)
/var/[product name] on /var/apache22/var/apache22/export/[product name] type none (rw,bind)
没有符号链接:
# file / /var /var/apache22 /var/apache22/var
/: directory
/var: directory
/var/apache22: directory
/var/apache22/var: directory
# uname -r
2.6.29.6
答案1
检查 Apache 是否正在运行chroot()
。我能想到的是你在哪里看到的情况/var/apache22/var
,但实际上并不意味着/var/apache22/var
。