-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys_get_temp_dir() not writeable on some shared hosts #310
Comments
Ugh. Thanks for the report, @iflow. Good point. I will implement some alternative. |
@iflow, do you mean that |
@RomanSyroeshko Yes that's what exactly happening |
@iflow, could you please test the implementation? Use |
Sry for the late response: I'm not sure how to use the new function.
And I'm not sure if it would work, because Template::__construct has not changed. There is still the line with tempnam, which does not use the user defined temporary directory.
|
I saw this issue and thought maybe the I can't look into this presently. I wanted to put a note out there for others who have need for, experience with, or been troubled by pesky errors reading and writing files in the system temporary directory. |
Hi, thanks @andrew-kzoo
You see, I through my own temporary directory to the tempnam function to fix the issue. It's not a nice solution, because it does influence future PhpWord updates. However this workaround works and so far I'm happy with it. |
@iflow, those line you mentioned looks like that now: $this->temporaryDocumentFilename = tempnam(Settings::getTempDir(), 'PhpWord'); The fix was put in |
Any news, @iflow? |
It works now (using develop branch)! Thank you. |
Good job @RomanSyroeshko ;) |
It was a genuine pleasure for me. :) |
On some shared hosts / webspaces the sys_get_temp_dir() is not accessable / writeable.
Therefore a new Template can not be generated. The following Exception is thrown:
"'Could not create temporary file with unique name in the default temporary directory.'"
I think the path, where the temporary files are stored should be configurable. So you can easily create a temp folder on your webspace and let PHPWord store the temp files there.
The text was updated successfully, but these errors were encountered: