Greetings,
I am moving piwigo from one machine
http://dingo-den.com/piwigo/index.php?nav=piwigo
to another.
I installed piwigo on the new machine and that worked fine as I now have a clean slate.
I downloaded the complete piwigo from the old machine minus the /local/config folder so it wouldn't overwrite the database config file.
rsync -av -e ssh --exclude /local/config /home/www/html/piwigo/ root@162.19.21.218:/home/www/html/piwigo
I verified that the images were downloaded.
cd /home/www/html/piwigo/_data/i/upload/2022/07/04 root@dingo5:/home/www/html/piwigo/_data/i/upload/2022/07/04# ls 20220704003056-1f3674fa-me.jpg 20220704003103-c5bb15f5-th.jpg 20220704003056-1f3674fa-sq.jpg 20220704003106-25a61024-me.jpg 20220704003056-1f3674fa-th.jpg 20220704003106-25a61024-sq.jpg 20220704003102-943c0099-me.jpg 20220704003106-25a61024-th.jpg 20220704003102-943c0099-sq.jpg 20220704003109-6acdd8f7-me.jpg 20220704003102-943c0099-th.jpg 20220704003109-6acdd8f7-sq.jpg 20220704003103-c5bb15f5-me.jpg 20220704003109-6acdd8f7-th.jpg 20220704003103-c5bb15f5-sq.jpg index.htm AND checked the upload file. root@dingo5:/home/www/html/piwigo/upload/2022/07/04# ls 20220704003056-1f3674fa.jpg 20220704003106-25a61024.jpg 20220704003102-943c0099.jpg 20220704003109-6acdd8f7.jpg 20220704003103-c5bb15f5.jpg index.htm
I then imported the database into the new machine.
mysqldump --opt -u root -p piwigo < /home/www/localhost/piwigo-8-7-2022.sql;
Now when I try and open my web page
http://162.19.21.218
the piwigo installation screen comes up ??
http://162.19.21.218/install.php
When I fill in the information I get
This page isn’t working162.19.21.218 is currently unable to handle this request. HTTP ERROR 500
I checked the /local/config/database.inc.php and it has the correct info
<?php $conf['dblayer'] = 'mysqli'; $conf['db_base'] = 'piwigo'; $conf['db_user'] = 'piwigo'; $conf['db_password'] = 'The Password'; $conf['db_host'] = 'localhost'; $prefixeTable = 'piwigo_'; define('PHPWG_INSTALLED', true); define('PWG_CHARSET', 'utf-8'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); ?>
Any help would be appreciated..
I cannot see my fenvironment details as I can't open the page
Piwigo URL: http://162.19.21.218/index.php?nav=piwigo
Last edited by Dingo001 (2022-07-10 10:41:48)
Offline
HTTP error 500 is a general server error nobody can answer but you (or the host owner) inspecting error logs and digging into things. However, there are quirks with your installation:
1.
Querying HEAD on your given IP gives
HTTP/1.1 302 Found
Location: install.php
an immediate temporary redirection to install.php
2.
If Piwigo is redirecting to install.php it means Piwigo can not evaluate the line
define('PHPWG_INSTALLED', true);
in local/config/database.inc.php, which in your case as the file seems to have it means Piwigo can not access local/config/database.inc.php.
Check the directory and file permissions of your installation and specifically local/config/ and local/config/database.inc.php
Offline
Hi
Thanks for the reply. I kew that PHP was installed but I checked anyway.
php --version PHP 8.1.2 (cli) (built: Jun 13 2022 13:52:54) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.2, Copyright (c) Zend Technologies with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
I had a look in the /local/config folder and the file database.inc.php was not executable
-rw-rw-rw- 1 www-data www-data 313 Jul 9 23:23 database.inc.php -rwxr-xr-x 1 www-data www-data 610 Jun 30 07:47 index.php
I changed it with
chmod +x database.inc.php
and it now looks like this
-rwxrwxr-x 1 www-data www-data 313 Jul 9 23:23 database.inc.php
I retried the web page but the install screen came up again.
I might reinstall again as I did have a blank piwigo when I installed.
What folders contain the images and the album info.
I know of these hold the photos but do not know where the album information is ??
/piwigo/upload
/piwigo/_data
If I know that then instead of downloading the whole piwigo I will just import the folders with the images and albums ??
Last edited by Dingo001 (2022-07-10 11:58:26)
Offline
I have piwigo back up but it is blank.
I looked in my /www/html folder and the index.php got overwritten by the piwigo index.php.
I guess I copied it over to the wrong folder ??
But now I still do not have any photos or albums even though the photos are in the folders /local/upload and _data ?
I must be missing something ??
Offline
PHP files don't need to be executable, they are interpreted by the web server's PHP module.
Piwigo won't work well with PHP 8.1, PHP 8.0 is already not completely supported, best is PHP 7.4 at the time being.
I don't know what you did to overwrite your /index.php with Piwigo's index.php, but
http://162.19.21.218/piwigo/
gives your running Piwigo installation (without images) (and now it seems you restored your old /index.php).
Note that whenever you write /local/config/ it looks suspicious to me, because it is an absolute path but should be local/config/ relative to the Piwigo directory, so in your case resulting in /home/www/html/piwigo/local/config/ but I think at the end you got that right because otherwise Piwigo wouldn't come up.
Make sure your database access is working and the database contains everything needed, i.e. the piwigo_images table has name entries and in column path actually has the entries for ./upload/...
Offline
Hello again,
I had a look at the table piwigo_images and it was empty. I looked at the extract file and there were lots and lots of entries in the table but they did not apply when I tried to import. I created a new import file from the old server just in case there was a problem with the one I had but I got the same result, the table is still empty.
mysqldump --opt -u root -p piwigo < /home/www/localhost/piwigo-9-7-2022.sql;
So I just extracted just the images table.
mysqldump -u root -p --databases piwigo --tables piwigo_images > export-to-new-server.sql;
The file was still big 3053917 Jul 10 22:19 export-to-new-server.sql
I sent it to the new server
scp -r /root/export-to-new-server.sql root@162.19.21.218:/home/www/localhost/ export-to-new-server.sql 100% 2982KB 4.1MB/s 00:00
The file is on the nw server and is the same size 3053917 Jul 10 22:27 export-to-new-server.sql
I tried to import the new file into the new server.
mysqldump --opt -u root -p piwigo < /home/www/localhost/export-to-new-server.sql
I had a look to see if the data was imported.
mysql -u root -p SELECT * FROM piwigo_images; Empty set (0.000 sec)
The table is still empty ???
Is it possible there is a setting that is limiting the number of rows imported somewhere ???
I had a look in the php.ini file and post_max_size = 100M , memory_limit = 256M , upload_max_filesize = 95M
So there shouldn't be a problem there as the file is just over 3M
Is there a file that contains the data on the old server that I can copy across ???
So I had a look to see where the data was kept on the old server.
SELECT @@datadir;
+-----------------+
| @@datadir |
+-----------------+
| /var/lib/mysql/ |
+-----------------+
1 row in set (0.00 sec)
I don't know what files to copy across so I don't mess up the new server ??
Last edited by Dingo001 (2022-07-11 05:13:09)
Offline
Hi
I found the solution. I was using mysqldump to import the data to the new database and it wasn't working. I used mysql and it imported all the files and data.
mysql -u root -p piwigo < /home/www/localhost/piwigo-9-7-2022.sql;
I can ow see my photos on http://162.19.21.218/piwigo/?nav=piwigo
Well that was a day or so that kept my 72 year old mind active.
Thank you to erAck for all his help.
Cheers,
Offline