加载XML文件或写入XML文件时出现问题

时间:2021-04-30 15:38:21

I have a GUI application which reads data from an XML file (current_users.xml) and also writes to that XML file. GUI is placed at /var/www/bin-release and XML files are located in the directory /home/os/work2/project/

我有一个GUI应用程序,它从XML文件(current_users.xml)读取数据,并写入该XML文件。 GUI位于/ var / www / bin-release,XML文件位于/ home / os / work2 / project /目录中

The GUI expects the XML file to be in the directory: /var/www/bin-release. So I created a symlink to /home/os/work2/project/current_users.xml in /var/www/bin-release. This with some other settings given below works fine on a number of PCs but on one particular PC, this setup does not cause the GUI to access the XML file rightly i.e. it neither reads nor writes to the XML file.

GUI期望XML文件位于以下目录中:/ var / www / bin-release。所以我在/ var / www / bin-release中为/home/os/work2/project/current_users.xml创建了一个符号链接。下面给出的一些其他设置可以在许多PC上正常工作,但在一台特定的PC上,此设置不会导致GUI正确访问XML文件,即它既不读取也不写入XML文件。

sudo ln -s /home/os/work2/current_users.xml /var/www/bin-release/current_users.xml
sudo chmod ug+rwx -R /var/www/bin-release
sudo chown $USER:www-data -R /var/www
sudo chown root:root /home/os/work2/current_user.xml
sudo chmod 666 /home/os/work2/current_users.xml
sudo usermod -a -G www-data $USER

Apache is being run by www-data as viewed via the output of ps -aux | grep apache

正如通过ps -aux |的输出所看到的那样,Apache正在由www-data运行grep apache

Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root      1442  0.0  0.3  36372  7528 ?        Ss   11:22   0:00 /usr/sbin/apache2 -k start
www-data  1452  0.0  0.3  36972  6308 ?        S    11:22   0:00 /usr/sbin/apache2 -k start
www-data  1453  0.0  0.3  36948  6300 ?        S    11:22   0:00 /usr/sbin/apache2 -k start
www-data  1454  0.0  0.3  36836  6292 ?        S    11:22   0:00 /usr/sbin/apache2 -k start
www-data  1455  0.0  0.2  36948  4820 ?        S    11:22   0:00 /usr/sbin/apache2 -k start
www-data  1457  0.0  0.2  36948  4724 ?        S    11:22   0:00 /usr/sbin/apache2 -k start
www-data  2325  0.0  0.2  36700  4656 ?        S    11:24   0:00 /usr/sbin/apache2 -k start
www-data  2343  0.0  0.2  36700  4656 ?        S    11:24   0:00 /usr/sbin/apache2 -k start
www-data  2344  0.0  0.2  36460  4864 ?        S    11:24   0:00 /usr/sbin/apache2 -k start
tahir     6686  0.0  0.0   4012   764 pts/0    S+   11:50   0:00 grep --color=auto apache

1 个解决方案

#1


0  

You might not have permission to enter the directory:

您可能没有权限进入目录:

$ chmod +x /home/os/work2/

#1


0  

You might not have permission to enter the directory:

您可能没有权限进入目录:

$ chmod +x /home/os/work2/