Replies: 4   Views: 3153
Internal server error
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 mcp  · 18-01-2018 - 10:47


I have just installed the advanced version on a windows server and I get an internal server error 500. 

I have run the check.php, everything is ok :

PHP_UNAME: Windows NT 007-MCP01 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) i586
PHP_SELF: /devis/index.php/do_things/mhh
ZipArchive: 1
DomDocument: 1
SimpleXMLElement: 1
Tidy: 1
mbstring: 1

Also, if I remove the key and domain from configuration file, I get 2 errors : 

1) Error while trying to write to Lettre_de_mission_222 please check write access. 

2) An uncaught Exception was encountered

Type: Exception

Message: There is not a valid license


I have played around with the temp_path and gave full rights to iis_IUSRS user for any of the tmp_path I have tried, but to no avail. I

I also ran sample_1.php in command line but could not find the output anywhere.

What else should I try next ? The test version was working perfectly on my test environment (wamp, not IIS) but I guess should have tried the same test version on the windows server too. 

I'm stuck and do not know what to try next :(

Posted by admin  · 18-01-2018 - 11:04


phpdocx is fully tested with PHP CLI mode and almost all web servers (IIS, apache, lighttpd, , nginx, Cherokee, ...), OS (Linux, Windows, macOS) and PHP handlers (mod_php, FastCGI, php-fpm, CGI...). So some rw access should be missing (IIS may need setting a custom temp_path with rw access in the config/phpdocxconfig.ini file).

As first test, after you have added the license key and copied all files, please run the most simple sample included in the package (Core/addText/sample_1.php) using the PHP CLI mode:

C:\...> php.exe sample_1.php

Please note that you may need to set the absolute path to php.exe if it's not as an env variable. The previous script must generate a DOCX in the same folder than the script; otherwise please check your server logs (maybe some PHP extension is missing for PHP CLI mode).

When you run it using IIS, what error do you see in the server logs? As an Internal Server Error is a generic error, the server logs should explain what's happening.


Posted by mcp  · 18-01-2018 - 12:09

PHP Warning:  require_once(../../../classes/ failed to open stream: No such file or directory in [...]\third_party\phpdocx\examples\Core\addText\sample_1.php on line 3

I have given the full control to IIS_IUSRS.

Is the relative path wrong or ... ?



Posted by admin  · 18-01-2018 - 12:23


The relative path is correct if you run the sample in the same folder than the script. Please check that all files have been copied and you are running the script in the same folder that the script exists; as it uses a relative path, you can't run:

C:\...>php.exe examples/Core/addText/sample_1.php

You need to access the examples folder and then run the script:

C:\...> cd examples/Core/addText

C:\...> php sample_1.php

You can also try to set an absolute path to, and also please check you can include correctly.

The error you are getting only appears if PHP can't read the file.


Posted by mcp  · 18-01-2018 - 13:51

Oops, indeed, I was running the sample from the wrong directory.

I finally made it work. I do not know exactly what I did, because I tried so many things, but I believe the internal server error was related to permissions.

Thank you for your help !