A PHP Error was encountere
Severity: Warnin
Message: file_put_contents(/var/www/htdocs/bluedoor/csair_activities/maidong/application/libraries/phpqrcode/qrcode-39bf1070a65c402944de8f0d3af660e7.png-errors.txt): failed to open stream: Permission denie
Filename: phpqrcode/qrtools.ph
Line Number: 10
第一次读取就报这样的错,第二次就不会了。
我这样写的php
include APPPATH . "libraries/phpqrcode/qrlib.php";
//
$data = mk_dir(now_time("Y"),"uploads/qrcode");
$errorCorrectionLevel = 'M';
$matrixPointSize = 6;
$url = mklink("welcome/shares",array("op" =>$this->OpenID));
$filename = $data["dirName"].DIRECTORY_SEPARATOR.'qrcode-'.md5($url.'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
if (! file_exists($filename)) {
QRcode::png($url, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
}
$data['photo'] = base_url($data['uploadPath'].DIRECTORY_SEPARATOR.basename($filename));
$data["info"]=$this->model("user")->com_getOne($where,NULL,"`nickname`,`headimgurl`");
$this->load->view('default/code',$data);
在模板是这样输出
<td align=center width="100"><img src='<?php echo "$photo";?>'></td>
错在哪里了
Severity: Warnin
Message: file_put_contents(/var/www/htdocs/bluedoor/csair_activities/maidong/application/libraries/phpqrcode/qrcode-39bf1070a65c402944de8f0d3af660e7.png-errors.txt): failed to open stream: Permission denie
Filename: phpqrcode/qrtools.ph
Line Number: 10
第一次读取就报这样的错,第二次就不会了。
我这样写的php
include APPPATH . "libraries/phpqrcode/qrlib.php";
//
$data = mk_dir(now_time("Y"),"uploads/qrcode");
$errorCorrectionLevel = 'M';
$matrixPointSize = 6;
$url = mklink("welcome/shares",array("op" =>$this->OpenID));
$filename = $data["dirName"].DIRECTORY_SEPARATOR.'qrcode-'.md5($url.'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
if (! file_exists($filename)) {
QRcode::png($url, $filename, $errorCorrectionLevel, $matrixPointSize, 2);
}
$data['photo'] = base_url($data['uploadPath'].DIRECTORY_SEPARATOR.basename($filename));
$data["info"]=$this->model("user")->com_getOne($where,NULL,"`nickname`,`headimgurl`");
$this->load->view('default/code',$data);
在模板是这样输出
<td align=center width="100"><img src='<?php echo "$photo";?>'></td>
错在哪里了