osh*_*nen 4 php lamp fopen ubuntu-10.04
我尝试加载我的一个php页面时收到以下错误:
[Fri Apr 08 22:59:50 2011] [错误] [client :: 1] PHP警告:fopen(tracking_id.txt):无法打开流:第61行/var/www/basic.php中的权限被拒绝
第61行是下面脚本的第二行:
$ourFileName = "tracking_id.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fwrite($ourFileHandle, $trackingId);
fclose($ourFileHandle);
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何解决这个问题?
我使用Ubuntu作为操作系统,使用apache作为Web服务器.
我使用tasksel来安装LAMP-server
创建一个名为tracking_id.txt的文件并对其执行以下命令:
chmod a+w tracking_id.txt
Run Code Online (Sandbox Code Playgroud)