Thursday, 21 March 2019

Export to excel error in PHP reports

I export reports as excel using PHP & MySql. I can export and open the file from my localhost using my source code, but unable to do in the server. When I try to export it shows
"
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home:/tmp:/usr) in /home/xx/xx.inc.php on line 205.
"
I googled through, but I'm unable get the solution.





$this->_tmpfilename=tempnam("/tmp", "excelreport");



$fh=fopen($this->_tmpfilename, "w+b");




This is the code that used. What's wrong.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...