Post by himanshu.aman » Fri Jan 23, 2015 7:44 pm

2015-01-23 17:13:36 - PHP Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/zpanel/hostdata/zadmin/public_html/ostudkart_com:/var/zpanel/tmp/) in /var/zpanel/hostdata/zadmin/public_html/ostudkart_com/system/PHPExcel/Classes/PHPExcel/Shared/File.php on line 175
2015-01-23 17:13:36 - PHP Warning: tempnam(): open_basedir restriction in effect. File() is not within the allowed path(s): (/var/zpanel/hostdata/zadmin/public_html/ostudkart_com:/var/zpanel/tmp/) in /var/zpanel/hostdata/zadmin/public_html/ostudkart_com/system/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php on line 197
2015-01-23 17:13:37 - PHP PHPExcel_Writer_Exception: Could not close zip file php://output. in /var/zpanel/hostdata/zadmin/public_html/ostudkart_com/system/PHPExcel/Classes/PHPExcel/Writer/Excel2007.php on line 399

Newbie

Posts

Joined
Fri Jan 23, 2015 7:38 pm

Post by janoo » Wed Sep 23, 2015 10:09 pm

I had the same problem. Try this:
1. create new folder with the name TMP in your opencart folder by FTP
2. open this file: System/PHPExcel/Classes/PHPExcel/Shared/File.php
3. find this text: return realpath(sys_get_temp_dir());
4. replace that text in the brackets with yours :
this should been directly for you:
return realpath("/var/zpanel/hostdata/zadmin/public_html/ostudkart_com:/var/zpanel/tmp/");
5. save the file.

I hope it will be helpful. If yes, please share it.

Newbie

Posts

Joined
Wed Sep 23, 2015 6:45 pm

Post by gartheman » Sun May 21, 2017 9:16 am

janoo wrote:
Wed Sep 23, 2015 10:09 pm
I had the same problem. Try this:
1. create new folder with the name TMP in your opencart folder by FTP
2. open this file: System/PHPExcel/Classes/PHPExcel/Shared/File.php
3. find this text: return realpath(sys_get_temp_dir());
4. replace that text in the brackets with yours :
this should been directly for you:
return realpath("/var/zpanel/hostdata/zadmin/public_html/ostudkart_com:/var/zpanel/tmp/");
5. save the file.

I hope it will be helpful. If yes, please share it.
Hi Janoo,

I was directed to this thread to try resolve a similar problem i'm having, resulting in errors:

Code: Select all

2017-05-19 23:39:19 - PHP Warning:  tempnam(): open_basedir restriction in effect. File() is not within the allowed path(s): (C:\CustomerData;D:\CustomerData;C:\PHPUploadData;C:\temp\phpupload;C:\Program Files\SWsoft\PEM\sysvhosts\elFinder) in C:\CustomerData\webspaces\webspace_00129445\wwwroot\opencart\system\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php on line 190
2017-05-19 23:39:19 - PHP Warning:  ZipArchive::open(): open_basedir restriction in effect. File(php://output) is not within the allowed path(s): (C:\CustomerData;D:\CustomerData;C:\PHPUploadData;C:\temp\phpupload;C:\Program Files\SWsoft\PEM\sysvhosts\elFinder) in C:\CustomerData\webspaces\webspace_00129445\wwwroot\opencart\system\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php on line 232
2017-05-19 23:39:19 - PHP Warning:  ZipArchive::open(): open_basedir restriction in effect. File(php://output) is not within the allowed path(s): (C:\CustomerData;D:\CustomerData;C:\PHPUploadData;C:\temp\phpupload;C:\Program Files\SWsoft\PEM\sysvhosts\elFinder) in C:\CustomerData\webspaces\webspace_00129445\wwwroot\opencart\system\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php on line 233
2017-05-19 23:39:19 - PHP PHPExcel_Writer_Exception:  Could not open php://output for writing. in C:\CustomerData\webspaces\webspace_00129445\wwwroot\opencart\system\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php on line 234
I tried to make changes like you suggested, but couldn't get it to work, it would just load a browser error message instead of the opencart error. From the erros above, can you offer any advice?

New member

Posts

Joined
Tue Feb 16, 2010 5:12 pm

Post by gartheman » Sun May 21, 2017 10:56 pm

hey, i kept at it, an eventually I got it:

In opencart\system\PHPExcel\Classes\PHPExcel\Writer\Excel2007.php I replaced:

Code: Select all

$pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp');
with:

Code: Select all

$pFilename = @tempnam('C:\CustomerData\webspaces\webspace_00129445\wwwroot\opencart/temp/', 'phpxltmp');
I wouldn't have figured it out with your above post, so thanks for that

New member

Posts

Joined
Tue Feb 16, 2010 5:12 pm
Who is online

Users browsing this forum: No registered users and 5 guests