我尝试谷歌解决方案并运行一些脚本进行自检。
在文件夹上添加了 test.php 并再次 chown-ed:
echo exec("who");
chgrp($path,$group_name);
chown($path, $user_name);
得到结果:
daemon
Warning: chgrp(): Operation not permitted in test.php
Warning: chown(): Operation not permitted in test.php
Array (
[name] => daemon
[passwd] => x
[uid] => 1
[gid] => 1
[gecos] => daemon
[dir] => /usr/sbin
[shell] => /usr/sbin/nologin
)
我很困惑为什么它是“守护进程”和 group:user 是 1:1,而不是我的 group:user。
所以我尝试用另一种方式在服务器端寻找任何东西,xampp设置部分,
并在 httpd.conf 上发现了一些东西:
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon
</IfModule>
然后我尝试更改组:用户:
<IfModule unixd_module>
User abc_user
Group ABC
</IfModule>
最后,我再次上传了ABC下的group:user:abc_user!!!!
但是.....如果我为某些程序使用会话,XAMPP 说它无法保存会话存在一个问题:(....
<br />\n<b>Warning</b>: session_start(): open(/opt/lampp/temp//sess_9k3dm9uv2gcgof1c37eacjlv36, O_RDWR)
failed: Permission denied (13) in <b>/opt/lampp/htdocs/upload.php</b> on line <b>1</b><br />\n
<b>Warning</b>: Unknown: open(/opt/lampp/temp//sess_9k3dm9uv2gcgof1c37eacjlv36, O_RDWR)
failed: Permission denied (13) in <b>Unknown</b> on line <b>0</b><br />\n<br />\n
<b>Warning</b>: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/opt/lampp/temp/) in <b>Unknown</b> on line <b>0</b><br />\n
听起来我需要将 temp 的路径更改为 /htdocs/ABC/temp 然后它应该可以工作,但它看起来很奇怪。
哪位天才有好主意?:)
感谢和问候。