PHP 7.1 PHP message: PHP Notice: tempnam(): file created in the system's temporary directory
Hello, I have installed the lastest Ubuntu Server 17.10 with PHP 7.1 to test the store.
Testing the Theme section, when I want to upload the logo of the store, the following error appears:
- An error happens during the logotype copy.
In the error.log of nginx you can see the following lines:
PHP message: PHP Notice: tempnam(): file created in the system’s temporary directory in /var/www/html/store/controllers/admin/AdminThemesController.php on line 2855" while reading response header from upstream, client: 192.168.1.68, server: www.store.com, request: “POST /admin1234/index.php?controller=AdminThemes&token=e2190e35953c445da7147b17e0ed7629 HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php7.1-fpm.sock:”, host: “www.store.com”, referrer: “https://www.store.com/admin1234/index.php?controller=AdminThemes&token=e2190e35953c445da7147b17e0ed7629”
2017/11/04 12:42:33 [error] 1039#1039: *1512 open() “/var/www/html/store/img/store-logo-1509795337.jpg” failed (2: No such file or directory)
I have seen there is and old bug created with similar content, and the idea to fix it was to find other function instead of tempnam().
Is a problem of PHP 7.1? Is interesting to keep that TB is compatible with PHP 7.1? Should TB provide a php.ini config file sample to fix it? Do you recommend to work with PHP 7.0 instead of 7.1?
Hmm i am not sure but this might be a permission based error.
But it can actually be a bug in 7.1 to https://bugs.php.net/bug.php?id=69489 - i am not 100% sure whats going on here.
TB runs on basic settings more or less, so no reason for a php.ini
One of my test sites is running php v7.1.11, and changing the logos worked fine for me…
As @bzndk suggests, maybe is a problem with permissions. I’m going to check it.
The problem was that some files were missing in the server due to .gitignore configuration. After copying it. Everything worked fine. Thank you!
Glad you figured it out and it was not a TB issue in the end.