zenphoto install 1.5.9

I am trying to install Zenphoto using a lamp stack that can be found here:
https://github.com/sprintcube/docker-compose-lamp
and it even runs on a raspberry which is really nice!
However when I try to install it on my server I always run into the problem that during install it cannot find the database because this is not on localhost but in another container. Therefore it always shows the page "a configuration error occurred pls try again later". When I provide the correct MySQL credentials in zenphoto.cfg.php the setup process is somehow skipped and it shows the Zenphoto License Agreement. When I click on "I agree" nothing happens. In the debug.log file there is this error message:

USER ERROR: MySQLi Error: ( SELECT value FROM [prefix]options WHERE name='Theme_colors' AND ownerid=0 AND theme='basic' ) failed. MySQLi returned the error Table 'zenphoto..options' doesn't exist in /var/www/html/zp-core/functions-db-MySQLi.php on line 95

And indeed the table zenphoto..options does not exist because the database was not created correctly!

I am using the docker-compose lamp stack with php74 and mysql57 with only minor modifications to the .env and docker-compose.yml files (apache document root changed and ssl enabled)

Any ideas? THX in advance!

Comments

  • acrylian Administrator, Developer

    If localhost does not work you have to enter the hostname or an IP address:
    https://www.php.net/manual/de/mysqli.construct.php

    Besider that I have no knowledge about Docker nor do I use it. Someone had made a docker image some year ago but it does not look maintained anymore: https://www.zenphoto.org/news/docker-zenphoto/

  • michas Member
    edited May 27

    Thx acrylian! Where in the zenphoto code do I need to make changes to account for a different database location? The mysql server can simply be accessed by entering 'database' as the database server instead of 'localhost'. This is how it works on the raspberrypi but strangely not on my main server.

  • michas Member

    Amazing! I got it resolved by inserting 'database' in the zenphoto_cfg.txt file in zp-core. The empty database must always be created first! But using PHPmyAdmin for that (part of the docker compose stack) works like a charm!

  • michas Member

    I have a full description of how to use the docker-compose lamp stack if anybody is interested

  • acrylian Administrator, Developer

    Amazing! I got it resolved by inserting 'database' in the zenphoto_cfg.txt file in zp-core. The empty database must always be created first! But using PHPmyAdmin for that (part of the docker compose stack) works like a charm!

    Ah, okay. Zenphoto's setup will try to create the database if it does not exists but in most case it is not allowed by the server. So technically it must be already created.

    I have a full description of how to use the docker-compose lamp stack if anybody is interested

    If you can place it somewhere on GitHub or something we gladly link to it, perhaps just as an individual entry like the one I mentioned above.

  • acrylian Administrator, Developer

    Amazing! I got it resolved by inserting 'database' in the zenphoto_cfg.txt file in zp-core. The empty database must always be created first! But using PHPmyAdmin for that (part of the docker compose stack) works like a charm!

    Jsut to add the actual config (php) file is within /zp-data after an install. The .txt file is just the template setup uses to create that file.

  • michas Member

    I understand that. But editing the zenphoto.cfg.php file didn't do the trick. instead changing the template helped to run the setup correctly

  • acrylian Administrator, Developer
    edited May 27

    instead changing the template helped to run the setup correctly

    If setup cannot create the php version the best way is to copy that template to zp-daten, rename it to .php and then fill the credentials. Because if it is there setup looks there first. Didn't that work?
    Files within zp-core should never be modified of course.

  • michas Member

    No it didn't work! This is what caused this thread. I put the correct credentials in the zenphoto.cfg.php file and this let to the error above in the debug.log:
    'zenphoto..options' doesn't exist
    The problem is the 2 dots ".." not sure where this comes from. Because of course the database does not have entries starting with 2 dots.

  • sbillard Member

    You have to put the correct credentials into the config file and then explicitly run setup. If setup has not been run all sorts of bad things might happen.

  • michas Member

    The setup did not even show up but in the setup.log it looked as if it had completed (after entering the correct credentials into the config file). The "agreement to license" page showed up but when clicking accept nothing happened. The show Gallery click showed a blank page.

  • acrylian Administrator, Developer
    edited May 28

    If you have a fresh install without any config file or any database respectively without tables setup will run automatically actually.

    If it is an existing install it will not, not even when teh database credentials are wrong, missing. It would be quite bad to expose that to the outside other than on fresh installs.

    If you reached the licence agreement you must have passed setup. It consists on two pages you cannot miss actually. Take a look here:
    https://www.zenphoto.org/screenshots/setup/setup-page1-systemcheck.jpg.html (these are not the very current version but generally the same still).

    You can run setup by accessing yoursite-install-path/zp-core/setup/. On existing installs you need to be login with admin rights and may have to enable setup files again.

    The show Gallery click showed a blank page.

    When ever you get a blank page review your server error log as that usual means a PHP fatal error that can be caused by numerous things.

Sign In or Register to comment.