[upgrade] mixed old and new files included through opcache #1790

Closed
opened 2026-10-05 00:56:46 +02:00 by adam · 0 comments
Owner

Right after the overwrite of previous version files by the unzip in the administration, PHP engine might still have old files in cache. We do not want to use the cache and force reload of all application files. Thus we need to disable opcache.

For example, on the server I'm testing upgrade from 13.8.0 to 14.0.0, I get in the database:

MariaDB [tmp_pwgmig]> select * from piwigo_upgrade order by applied desc limit 10;
+-----+---------------------+----------------------------------------------------+
| id  | applied             | description                                        |
+-----+---------------------+----------------------------------------------------+
| 165 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.000 s] Add...  |
| 166 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.009 s] Crea... |
| 167 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.001 s] add ... |
| 170 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.000 s] add ... |
| 169 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.006 s] Dele... |
| 168 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.006 s] Crea... |
| 70  | 2023-12-11 17:22:28 | upgrade included in installation                   |
| 67  | 2023-12-11 17:22:28 | upgrade included in installation                   |
| 66  | 2023-12-11 17:22:28 | upgrade included in installation                   |
| 63  | 2023-12-11 17:22:28 | upgrade included in installation                   |
+-----+---------------------+----------------------------------------------------+
10 rows in set (0.001 sec)

Obviously upgrade 165 couldn't be applied in Piwigo 13.8.0. It's a new upgrade script in Piwigo 14!

Piwigo think we're on 13.8.0 because the old include/constants.inc.php is still in opcache. Same problem for sub-files of Smarty.

Right after the overwrite of previous version files by the unzip in the administration, PHP engine might still have old files in cache. We do not want to use the cache and force reload of all application files. Thus we need to disable opcache. For example, on the server I'm testing upgrade from 13.8.0 to 14.0.0, I get in the database: ``` MariaDB [tmp_pwgmig]> select * from piwigo_upgrade order by applied desc limit 10; +-----+---------------------+----------------------------------------------------+ | id | applied | description | +-----+---------------------+----------------------------------------------------+ | 165 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.000 s] Add... | | 166 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.009 s] Crea... | | 167 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.001 s] add ... | | 170 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.000 s] add ... | | 169 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.006 s] Dele... | | 168 | 2023-12-11 17:22:40 | [migration from 13.0.0 to 13.8.0, 0.006 s] Crea... | | 70 | 2023-12-11 17:22:28 | upgrade included in installation | | 67 | 2023-12-11 17:22:28 | upgrade included in installation | | 66 | 2023-12-11 17:22:28 | upgrade included in installation | | 63 | 2023-12-11 17:22:28 | upgrade included in installation | +-----+---------------------+----------------------------------------------------+ 10 rows in set (0.001 sec) ``` Obviously upgrade 165 couldn't be applied in Piwigo 13.8.0. It's a new upgrade script in Piwigo 14! Piwigo think we're on 13.8.0 because the old `include/constants.inc.php` is still in `opcache`. Same problem for sub-files of Smarty. <!-- github-sync-id:2036066203 -->
adam closed this issue 2026-10-05 00:56:46 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1790