为什么我不能写(保存)到'htdocs'里面的目录? [英] why can't i write (save) into a directory inside 'htdocs'?

查看:102
本文介绍了为什么我不能写(保存)到'htdocs'里面的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

任何人都可以告诉我为什么我不能使用perl写入(保存)文件到''../apache2/htdocs/''内的目录中脚本如''open(OUTPUT,"> result / blast_fasta_input");'',其中''result''是''htdocs''内的目录。非常令人惊讶的是,当我这样做时,它工作正常(写入):打开(OUTPUT,"> / tmp / blast_fasta_input");,虽然我无法从那里读取文件。

以下是''../apache2/htdocs/result''和''/ tmp''的文件权限如何:

drwxr-xr-x 2 root其他512 Mar 29 14:47结果

drwxrwxrwt 5 root sys 847 3月29日14:44 tmp


谢谢

hello!
can anyone plz tell me why i can''t write (save) file into a directory which is inside the ''../apache2/htdocs/'' using a perl script like ''open(OUTPUT,">result/blast_fasta_input");'', where ''result'' is a directory inside the ''htdocs''. quite surprisingly, it works fine (writes) when i do this: open(OUTPUT,">/tmp/blast_fasta_input");,although i can''t read the file from there.
following is how the file permission look like for both the ''../apache2/htdocs/result'' and the ''/tmp'':
drwxr-xr-x 2 root other 512 Mar 29 14:47 result
drwxrwxrwt 5 root sys 847 Mar 29 14:44 tmp

thanks

推荐答案

rwx组分别用于所有者,组和用户。


cgi脚本不作为所有者运行,您需要将权限更改为
结果目录中的
drwxrwxrwx。
the rwx groups are for owner, group and user respectively.

cgi scripts do not run as owner you will need to change the permissions to

drwxrwxrwx on your result directory.


您好Banfa,

我将目录(../apache2/htdocs/result/)更改为你建议,现在脚本在结果目录中创建一个文件,但是没有它的内容(它是空的)。我想在该文件中看到一个蛋白质序列(我粘贴到我的html页面的textarea上的序列)。我还想知道,当我将它保存在/ tmp目录中时,我也可以看到该文件的内容。

这是我尝试的方式:

open(OUTPUT,"> result / blast_fasta_input");
Hi Banfa,
I changed the directory (../apache2/htdocs/result/) permission as you suggested, and now the script creates a file in the result directory, but without its content (it is empty). I''m suppose to see a protein sequence in that file (the sequence that I pasted onto the textarea of my html page). I would also like you to know that when I save it in the /tmp directory, I can see the content of the file as well.
Here is how I tried:

open(OUTPUT,">result/blast_fasta_input");


fasta_file =
fasta_file=


这篇关于为什么我不能写(保存)到'htdocs'里面的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆