Forum


Replies: 3   Views: 1077
Error while trying to write ... please check write access.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by irishadar  · 04-05-2017 - 19:29

Edited by irishadar · 05-05-2017 - 11:52

Hi,

I have upgraded to 7.0 version and i started to get this error "" , but the document is created on server. 

the line invoking the error is :

$docx->createDocx('\\\\netapp2020\\menorah\\word_docs\\'.$variables['FILENUM']);

the error coms  from class "DOCXStructure.inc" (line 144) , as if it is testing for its readability  befor it gets created or at the same time.

 the same code is working fine on version 6.5.

if i use local folder instead of network one it is working fine as well.

 

what am i missing ?

how can i fix this ?

iris

Posted by admin  · 05-05-2017 - 06:34

Hello,

The file DOCXStructure.inc included in phpdocx 7 is the same than phpdocx 6.5. It just add a new option to return the structure of the class instead of creating the DOCX file, but the lines you refer in this file:

if (!is_writable($path) || !is_readable($path)) {
   die('Error while trying to write to ' . $path . ' please check write access.');
}

are the same in both phpdocx 7 and phpdocx 6.5.

We recommend you to check if the server is returning a wrong false. For example if you are using Samba you need to configure it correctly:

https://bugs.php.net/bug.php?id=68926

Anyway, as all payment licenses of phpdocx are open source (not free source; so you can change the code but not redistribute it), you could remove that lines from DOCXStructure.inc. That lines only check if the file can be written correctly, but you can comment or remove them.

Regards.

Posted by irishadar  · 05-05-2017 - 12:00

Hi,

Thanks for your prompt answer. I am using php ver 7.1 though, but i still getting the error , so i think i will take your advice and comment out these lines.

 

thanks again,

iris hadar

Posted by admin  · 05-05-2017 - 14:49

Hello,

phpdocx is fully tested and compatible with PHP 5.2, 5.3, 5.4, 5.5, 5.6, 7.0 and 7.1 We think the problem is some wrong configuration in the network service.

Anyway, you can remove that lines to avoid the file checking.

Regards.