Handle "Notice: tempnam()" message

forreggbor
14 Posts
forreggbor posted this 30 December 2017

After upgrading to php 7.1.x or 7.2 I always get the attached message in Themler. I would say it appears every time when Themler creates any temp file so very-very often.
As I read this is a php "feature" since php 7.1. Somebody reported that the tempnam() function should raise notice if falling back to temp dir.
http://php.net/ChangeLog-7.php#7.1.0
https://bugs.php.net/bug.php?id=69489

Even if I set the upload_tmp_dir in php.ini I get this message.

I found that I can fire out this message from my screen only if I change the code in editor/app_backend/common.php in the line 410. There are two possible changes:
original: $zipPath = tempnam('tmp', 'str_zip');
modification 1: $zipPath = @tempnam('tmp', 'str_zip');
modification 2: $zipPath = tempnam('/tmp', 'str_zip');
The first only suppress the message.
The second one looks better as it expicitly define the temp folder in the root folder of the site.

Do you have any other idea?

After upgrading to php 7.1.x or 7.2 I always get the attached message in Themler. I would say it appears every time when Themler creates any temp file so very-very often. As I read this is a php "feature" since php 7.1. Somebody reported that the tempnam() function should raise notice if falling back to temp dir. http://php.net/ChangeLog-7.php#7.1.0 https://bugs.php.net/bug.php?id=69489 Even if I set the upload_tmp_dir in php.ini I get this message. I found that I can fire out this message from my screen only if I change the code in __editor__/app_backend/common.php in the line 410. There are two possible changes: original: $zipPath = tempnam('tmp', 'str_zip'); modification 1: $zipPath = @tempnam('tmp', 'str_zip'); modification 2: $zipPath = tempnam('/tmp', 'str_zip'); The first only suppress the message. The second one looks better as it expicitly define the temp folder in the root folder of the site. Do you have any other idea?
Vote to pay developers attention to this features or issue.
2 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 05 January 2018

Hi,

Sorry for the delay.
Did you try to hide the notices in php.ini? This may help too.

Thank you,
Olivia

Hi, Sorry for the delay. Did you try to hide the notices in php.ini? This may help too. Thank you, Olivia
ernst.andersen
1 Posts
ernst.andersen posted this 2 weeks ago

Hey there,
I have the same error message, when exporting the file from an online editor as .zip
The two suggestions above help suppress the error message, and therefore a zip file is exported, however the zip files created are no valid zip files and I cannoit reimport them... .
Is there a fix for that?

Kind regards,

Hey there, I have the same error message, when exporting the file from an online editor as .zip The two suggestions above help suppress the error message, and therefore a zip file is exported, however the zip files created are no valid zip files and I cannoit reimport them... . Is there a fix for that? Kind regards,
You must log in or register to leave comments