Applies To:

Zend Server 7, 8 or later (reinstall / upgrade)
Admin UI Login Screen

Summary

In normal Zend Server workflows, once a new setup has been launched successfully, a new Administrator user is generated with an initial password and login is enabled.

Problem

This article should help in case the users list in the Zend Server Admin UI becomes empty or malformed, most probably after a version upgrade / downgrade to Zend Server (or reinstall of the same version after problems).

As a result of an empty users table, you cannot select a user (Admin / Developer) and normal login is not possible.

Solution (validated on Linux)

Open root console, or run the following with 'sudo <command>'.

1. Backup GUI DB

# cp /usr/local/zend/var/db/gui.db{,-orig}

2. Check Existing Users

# sqlite3 /usr/local/zend/var/db/gui.db "select * from GUI_USERS;"

Important! Record any output which is NOT EMPTY for reference!

Note: If you get results (users)
we are going to delete any user we find to flush this table:

# sqlite3 /usr/local/zend/var/db/gui.db "delete from GUI_USERS;"


3. Insert Admin User (password: zend)

# sqlite3 /usr/local/zend/var/db/gui.db "insert into GUI_USERS values (1, 'admin', '7bf63868e601433ffaebf27865141d9d36fdbd5723c97b2b43f66b8d1ae3f4b1', 'administrator');"

4. If you need a Developer user (password: zend)

# sqlite3 /usr/local/zend/var/db/gui.db "insert into GUI_USERS values (2, 'developer', '7bf63868e601433ffaebf27865141d9d36fdbd5723c97b2b43f66b8d1ae3f4b1', 'developer');"

5. Extra Step securing passwords!!!

This is critical if Zend Server is not private or local, and users can try to access it without permissions.

Note: initial passwords presented here are 'zend' (without the quotes).
To generate hash from a known password, run and copy to the SQLite commands above, replacing the given hash for user 'zend':
# /usr/local/zend/bin/php -r "echo hash('sha256', 'zend').\"\n\";"

You can also modify the passwords once you login to the Admin UI, under Administration -> Users (you need to provide existing password and the new password).

Solution (Windows)

TBD (we don't have reports yet on Windows missing GUI users, however the flow is exactly the same, without using SQLite3 but some other SQLite v.3 client editor for Windows)