again: OPEN_BASEDIR RESTRICTION problem

Topics: Developer Forum, User Forum
Apr 21, 2009 at 11:04 AM
Edited Apr 21, 2009 at 11:07 AM
Hi,
maybe someone can help: after browsing through the forum and searching goole for some hours I'm close to give up :-(. When trying to run /Tests/01simple.php (or any other script within that folder) I get the following error:

12:53:38 Create new PHPExcel object 12:53:38 Set properties 12:53:38 Add some data 12:53:38 Rename sheet 12:53:38 Write to Excel2007 format
Warning: file_exists() [function.file-exists.html]: open_basedir restriction in effect. File(/PHPExcel/Writer/Excel2007.php) is not within the allowed path(s): (/var/www/vhosts/xxx.de/httpdocs:/tmp) in /var/www/vhosts/xxx.de/httpdocs/skm_sus/includes/excel_export/Classes/PHPExcel/IOFactory.php on line 201

Fatal error: Class 'ZipArchive' not found in /var/www/vhosts/xxx.de/httpdocs/skm_sus/includes/excel_export/Classes/PHPExcel/Writer/Excel2007.php on line 285

Does anyone know how to get the script working on a "shared host server configuration"? Please help!

Thank you very much..
Trainer
Developer
Apr 21, 2009 at 1:37 PM
Can you take a look at this thread and see if you have a similar weird include path?
http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=49149

Apr 21, 2009 at 2:07 PM
Hi koyama,

thanks for your quick reply! 

The path is  " .::../Classes/".

Greetings Trainer
Developer
Apr 21, 2009 at 2:42 PM
This is what I expected. Two adjacent semicolons in the include_path causing IOFactory trying to load files from root.

Work item created:
http://phpexcel.codeplex.com/WorkItem/View.aspx?WorkItemId=9814

@trainer_p: You can help us solving this issue by trying the patch uploaded there and report back whether it works.

Apr 21, 2009 at 10:17 PM
The patch worked!

I'm able to create Excel5 sheets now!!!

Excel2007 doesn't work,because (I suppose)  my php-version does not support the zip files: Fatal error: Class 'ZipArchive' not found in /var/www/vhosts/xxx.de/httpdocs/skm_sus/includes/excel_export/Classes/PHPExcel/Writer/Excel2007.php
Or is there a solution for that, too?

Anyway, thank you very much, koyama!
Developer
Apr 21, 2009 at 11:09 PM
Great that it is working, and I see that Maarten has already applied patch in source code.

Second error message is because zip extension is missing. You need to contact your web hosting provider and ask them to add the zip extension to the PHP installation.