您好,欢迎访问一九零五行业门户网

!在Yii中使用fopen找不到路径

求助!在yii中使用fopen找不到路径
我的代码写在view中php文件,
具体代码:
$file_url=yii::app()->request->baseurl./file/;
$file_name=$file_url.'test.txt'; 
if($file=fopen($file_name, w)){
 fwrite($file, '这是测试内容1');
 fclose($file);
}
显示错误:
fopen(/yiitest/file/test.txt) [function.fopen]: failed to open stream: no such file or directory
------解决方案--------------------
baseurl 是网站的路径... fopen打开的是文件系统的路径的,不能混为一谈的.
------解决方案--------------------
路径加上域名就可以了
------解决方案--------------------
探讨
baseurl 是网站的路径... fopen打开的是文件系统的路径的,不能混为一谈的.
其它类似信息

推荐信息