[英]fopen permission denied
I am getting the following error when I try loading one of my php pages: 我尝试加载我的一个php页面时收到以下错误:
[Fri Apr 08 22:59:50 2011] [error] [client ::1] PHP Warning: fopen(tracking_id.txt): failed to open stream: Permission denied in /var/www/basic.php on line 61
[Fri Apr 08 22:59:50 2011] [错误] [client :: 1] PHP警告:fopen(tracking_id.txt):无法打开流:第61行/var/www/basic.php中的权限被拒绝
Line 61 is the second line from the script below: 第61行是下面脚本的第二行:
$ourFileName = "tracking_id.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fwrite($ourFileHandle, $trackingId);
fclose($ourFileHandle);
Anyone know how this can be resolved? 任何人都知道如何解决这个问题?
I am using Ubuntu as the OS, and apache as the webserver. 我使用Ubuntu作为操作系统,使用apache作为Web服务器。
I used tasksel to install LAMP-server 我使用tasksel来安装LAMP-server
创建一个名为tracking_id.txt的文件并对其执行以下命令:
chmod a+w tracking_id.txt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.