PHP warning

tempnam(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/restricted)

/var/www/restricted/survey/application/third_party/xlsx_writer/xlsxwriter.class.php(53)

41     public function __destruct()
42     {
43         if (!empty($this->temp_files)) {
44             foreach($this->temp_files as $temp_file) {
45                 @unlink($temp_file);
46             }
47         }
48     }
49
50     protected function tempFilename()
51     {
52         $tempdir = !empty($this->tempdir) ? $this->tempdir : sys_get_temp_dir();
53         $filename = tempnam($tempdir, "xlsx_writer_");
54         $this->temp_files[] = $filename;
55         return $filename;
56     }
57
58     public function writeToStdOut()
59     {
60         $temp_file = $this->tempFilename();
61         self::writeToFile($temp_file);
62         readfile($temp_file);
63     }
64
65     public function writeToString()

Stack Trace

#0
+
 /var/www/restricted/survey/application/third_party/xlsx_writer/xlsxwriter.class.php(53): tempnam("/tmp", "xlsx_writer_")
48     }
49
50     protected function tempFilename()
51     {
52         $tempdir = !empty($this->tempdir) ? $this->tempdir : sys_get_temp_dir();
53         $filename = tempnam($tempdir, "xlsx_writer_");
54         $this->temp_files[] = $filename;
55         return $filename;
56     }
57
58     public function writeToStdOut()
#1
+
 /var/www/restricted/survey/application/third_party/xlsx_writer/xlsxwriter.class.php(117): XLSXWriter->tempFilename()
112     {
113         //if already initialized
114         if ($this->current_sheet==$sheet_name || isset($this->sheets[$sheet_name]))
115             return;
116
117         $sheet_filename = $this->tempFilename();
118         $sheet_xmlname = 'sheet' . (count($this->sheets) + 1).".xml";
119         $this->sheets[$sheet_name] = (object)array(
120             'filename' => $sheet_filename,
121             'sheetname' => $sheet_name,
122             'xmlname' => $sheet_xmlname,
#2
+
 /var/www/restricted/survey/application/third_party/xlsx_writer/xlsxwriter.class.php(205): XLSXWriter->initializeSheet("OLD SG GTS 2016")
200     public function writeSheetRow($sheet_name, array $row, $style=null)
201     {
202         if (empty($sheet_name) || empty($row))
203             return;
204
205         self::initializeSheet($sheet_name);
206         $sheet = &$this->sheets[$sheet_name];
207         if (empty($sheet->columns))
208         {
209             $sheet->columns = $this->initializeColumnTypes( array_fill($from=0, $until=count($row), 'GENERAL') );//will map to n_auto
210         }
2017-03-07 18:12:02 Apache Yii Framework/1.1.16