Jump to content

[SOLVED] Prestashop 8.2.2 - new installation fails on rename tmp/class to var/cache


Thbor83

Recommended Posts

Hi, after I have attempted to get the multistore running I gave up and made new stores instead for each domain, and now I have a new installation for one of them, but it fails on installation.

When I go to shop.com/install I get this error

Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/class_index.php1WNAIL" to "/var/www/html/shop_com/var/cache/dev/class_index.php". in /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:290 Stack trace: #0 /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(696): Symfony\Component\Filesystem\Filesystem->rename() #1 /var/www/html/shop_com/vendor/prestashop/autoload/src/LegacyClassLoader.php(160): Symfony\Component\Filesystem\Filesystem->dumpFile() #2 /var/www/html/shop_com/vendor/prestashop/autoload/src/LegacyClassLoader.php(75): PrestaShop\Autoload\LegacyClassLoader->dumpClassIndex() #3 /var/www/html/shop_com/vendor/prestashop/autoload/src/PrestashopAutoload.php(47): PrestaShop\Autoload\LegacyClassLoader->buildClassIndex() #4 /var/www/html/shop_com/vendor/prestashop/autoload/src/PrestashopAutoload.php(38): PrestaShop\Autoload\PrestashopAutoload->generateIndex() #5 /var/www/html/shop_com/vendor/prestashop/autoload/src/Autoloader.php(77): PrestaShop\Autoload\PrestashopAutoload->PrestaShop\Autoload\{closure}() #6 /var/www/html/shop_com/config/config.inc.php(54): PrestaShop\Autoload\Autoloader->load() #7 /var/www/html/shop_com/index.php(27): require('...') #8 {main} thrown in /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 290

 

The server are rocky linux, with nginx, php 8.3.23

Tried to set different settings, like 777 on the folders, right now it is 755 on folders and 644 on files.
Owner on folders are nginx user, tried also root to see but I still get the error no matter what.

Folders under /var/cache/dev and prod are empty, the folders where created manually due to permissions error.

Does anyone have any idea here? I have read the forum but most seems to be about that the folder are missing for /var/cache

Edited by Thbor83
Figured out what the problem was, solution added (see edit history)
Link to comment
Share on other sites

PrestaShop 8.2.2 is not compatible with PHP 8.3. You need PHP 8.1 (recommended) or 8.2.

sorry I thought I did not know prestashop version, it was in the title....I have 14 grandchildren and have my moments.

change php to 8.1

Link to comment
Share on other sites

1 hour ago, El Patron said:

PrestaShop 8.2.2 is not compatible with PHP 8.3. You need PHP 8.1 (recommended) or 8.2.

sorry I thought I did not know prestashop version, it was in the title....I have 14 grandchildren and have my moments.

change php to 8.1

Ah, according to page it only says you needed 8.1 or newer so it seemed to be compatible. 

I have downgraded now, but get still this message

Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/class_index.phpMxALsC" to "/var/www/html/shop_com/var/cache/dev/class_index.php". in /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:290 Stack trace: #0 /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(696): Symfony\Component\Filesystem\Filesystem->rename() #1 /var/www/html/shop_com/vendor/prestashop/autoload/src/LegacyClassLoader.php(160): Symfony\Component\Filesystem\Filesystem->dumpFile() #2 /var/www/html/shop_com/vendor/prestashop/autoload/src/LegacyClassLoader.php(75): PrestaShop\Autoload\LegacyClassLoader->dumpClassIndex() #3 /var/www/html/shop_com/vendor/prestashop/autoload/src/PrestashopAutoload.php(47): PrestaShop\Autoload\LegacyClassLoader->buildClassIndex() #4 /var/www/html/shop_com/vendor/prestashop/autoload/src/PrestashopAutoload.php(38): PrestaShop\Autoload\PrestashopAutoload->generateIndex() #5 /var/www/html/shop_com/vendor/prestashop/autoload/src/Autoloader.php(77): PrestaShop\Autoload\PrestashopAutoload->PrestaShop\Autoload\{closure}() #6 /var/www/html/shop_com/config/defines_uri.inc.php(77): PrestaShop\Autoload\Autoloader->load() #7 /var/www/html/shop_com/install/init.php(149): require_once('...') #8 /var/www/html/shop_com/install/index.php(43): require_once('...') #9 {main} thrown in /var/www/html/shop_com/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 290

No worries, that is alot of grandchildrens :D 

Link to comment
Share on other sites

I figured out after the upgrade that I needed to run this commands first due to SElinux

sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/prestashop(/.*)?"
sudo restorecon -Rv /var/www/html/prestashop/

Will set it to RESOLVED, thanks for the help on the way to the goal El Patron :D

  • Thanks 1
Link to comment
Share on other sites

  • Thbor83 changed the title to [SOLVED] Prestashop 8.2.2 - new installation fails on rename tmp/class to var/cache

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...