Replies: 3   Views: 1755
Still getting permission denied
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 bars  · 16-03-2017 - 16:28


We are trying to convert an html file to docx file, and came across your solution which might work for us.

I am trying to examine if the conversion will work before we make a purchase, although I am constantly getting Permission denied.

When we read the file with fopen, it does work resulting in a docx file without the external css (not good).

I have followed every post here and checked everything from files permissions to php user running and php.ini configurations, but i keep getting :

PHP Fatal error:  Uncaught Exception: Permission denied on myfile.html. in /Library/WebServer/Documents/pathToPHPDocX/lib/dompdfParser/include/parserhtml.cls.php:308

Stack trace:
#0 /Library/WebServer/Documents/pathToPHPDocX/lib/dompdfParser/include/parserhtml.cls.php(876): PARSERHTML->load_html_file('myfile.htm...')
#1 /Library/WebServer/Documents/pathToPHPDocX/classes/ : eval()'d code(629): PARSERHTML->getDompdfTree('myfile.htm...', true, '*', false, ':///')
#2 /Library/WebServer/Documents/pathToPHPDocX/classes/ : eval()'d code(601): HTML2WordML->renderDompdf('myfile.htm...', true, '*', false, ':///')
#3 /Library/WebServer/Documents/pathToPHPDocX/classes/ HTML2WordML->render('myfile.htm...', Array)
#4 /Library/WebServer/Documents/hello.php(19): CreateDocx->embedHTML('myfile.htm...', Array)
#5 {main}
  thrown in /Library/WebServer/Documents/pathToPHPDocX/lib/dompdfParser/include/parserhtml.cls.php on line 308

When running from localhost and terminal.

I am using mac OSX with no addons.


I need to fix the css not been included when passing html as string, or the permission issue to try and include the css by file.


Waiting for a response.

Thank you in advance.