Hello,
Recently I saw that my Piwigo photo albums were no longer working. I would get an error about an unexpected [ in the index.php file. Upon further looking, I found that my pwigo_history in the database was 1.7 GB in length with 33,000,000+ entries in it. I might be a good photographer, but not that good. I suspect that somehow it got hacked.
I'm running 2.4.3. Yes, I know, ancient, but if it ain't broke, don't fix it, and I had plenty of other stuff to work on elsewhere. So, I decided to update to the latest version. I was also running PHP 5.7.
I found that I could access then /admin.php page, and log in. When I clicked on the Update to 14.5, I received the following error:
Fatal error: Can't use function return value in write context in /usr/www/users/gschultz/GeoffSchultz/Photos/include/functions.inc.php on line 632
I guessed that this was being caused by PHP 5.7, so I tried updating to PHP 8.2, but then I got the following, which is caused by mysql_connecting being removed in PHP 7.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/www/users/gschultz/GeoffSchultz/Photos/include/dblayer/functions_mysql.inc.php:23
So, I'm trying to figure out how to update this. I assume that there are all kinds of changes to the database, so it's just not a simple matter of doing a clean install of 14.5 and pointing it at my 2.4 database. Note that I have over 9,000 photos in 578 albums, so recreating this is not an option.
Does anyone have any suggestions on how I can get myself out of this?
Thanks, Geoff
Piwigo version
Piwigo 2.4.3
Environment
Operating system: FreeBSD
PHP: 5.2.17 (Show info) [2024-07-31 12:34:31]
mysql: 8.0.36 [2024-07-31 12:34:31]
Graphics Library: External ImageMagick 7.1.1-14
Database
9209 photos (first photo added on Wednesday 18 July 2012)
578 albums including 558 physical and 20 virtual (9245 associations)
1026 keywords (20365 associations)
35 users
1 group
1 comment
84 rates
Piwigo URL: https://geoffschultz.org/photos
Offline
I noticed a drastic increase in photos in my system as well last week. I'm still not sure the reason but suspect the symlinks for my NFS mount wasn't created successfully after a server reboot. I have a daily cron that will sync my album folders. I think the syncronization was most likely duplicating my albums and photos.
Most web applications require a sequential upgrade process. V1 to v2. Sometimes skipping versions works but not always.
I suspect that you have your system backed up and back to where it was prior to the upgrade now? Can you replicate your setup on a staging environment and test upgrading through the older versions one by one?
PHP 5.4, wow. That's really old and insecure. Thanks for chuckle. You will find PHP 8+ to be more performance and secure.
Last edited by raupie (2024-08-01 04:25:17)
Offline
On my mobile I can see an "order by rank" error in SQL syntax. This is discussed in other threads. Please look them up and follow instructions there to solve this.
Offline
You're quite in a dilemma. With Piwigo 2.4.3 and PHP 8 you won't get anywhere, and as you wrote about mysql_connect() being required that's removed in PHP 7.0 there's also not the option to use any newer PHP for the upgrade.
What you maybe could do is switch to PHP 8.1 and do not touch Piwigo from the web interface anymore but do a manual upgrade, see https://piwigo.org/guides/update/manual
Offline
I updated PHP to 8.2 and converted my website code from MySQL to MySQLI. That's working fine, but if I try to run that code under PHP 5.x, it fails due to changes in MySQLI. So, I need to go forward with PHP 8.2, which is a good thing.
I tried following the Piwigo Manual Update procedures, as described at https://piwigo.org/guides/update/manual . I deleted all of the files/directories as described, and then FTPed the Piwigo 14.5 files over the top of my existing /photos directory. I assume that I should overwrite any existing files. The documentation doesn't answer this.
When I access the /photos/upgrade.php web page, it displays nothing. Zip, zero, zilch. Nothing seems to occur, regardless of how long I wait.
My only thought is to create a clean install of 14.5 pointing at a new database. Then change the config file to point at the old 2.4 database, and run the upgrade.php which will hopefully make the necessary changes to db fields.
Any thoughts on this?
-- Geoff
Last edited by geoffschultz (2024-08-02 00:20:55)
Offline