在PHP中,为什么不写入test.txt? [英] In PHP, why won't this write to test.txt?

查看:78
本文介绍了在PHP中,为什么不写入test.txt?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码是

<?php
$fp = fopen('test.txt', "a+");
fwrite($fp, 'Cats chase mice');
fclose($fp);
?>

,但test.txt仍然为空.我没有发现任何错误,也无法理解为什么它没有书写.

but test.txt is still empty. I don't see anything wrong and I don't understand why it's not writing.

推荐答案

在控制台中写入

chmod a+w test.txt 

这篇关于在PHP中,为什么不写入test.txt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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