Problem installing Omeka 2.7 on Ubuntu 18.04LTS as localhost

I had Omeka 2.6 running under Ubuntu 18.04 LTS as localhost with Neatline and all seemed fine. Then I tried to add plugin Admin Images and that failed. Advice from the Forum suggested best to reinstall it.

In the meantime I thought it a good idea to first upgrade to Omeka 2.7. Following Omeka instructions all went well and 2.7 ran, at least until I rebooted the PC after the install. Then Omeka failed and inspection showed something to do with Apparmor. My conclusion: something somewhere in the original install is badly wrong so I decide to start from scratch.

https://askubuntu.com/questions/1073402/remove-re-install-lamp-with-current-versions-on-ubuntu-18-04. to remove LAMP then
https://websiteforstudents.com/install-omeka-classic-cms-on-ubuntu-16-04-17-10-18-04-with-apache2-mariadb-and-php-7-2/ to put LAMP back again

At the end of that Mysql is OK, Apache is OK but http://localhost/phpinfo.php just shows a blank page. Can’t work out why so switch to
https://www.howtoforge.com/tutorial/ubuntu-omeka-classic-cms-installation/ because they don’t test PHP. I follow that until it’s time to test for Omeka running but it fails immediately with

Omeka fatal error: The Mysqli extension is required for this adapter but the extension is not loaded.\n\nConfirm that the information in your db.ini file is correct.

Much Googling didn’t help so it’s back to the forum. Any ideas?

Hi Brian1,

I have so many questions but I will start with your Mysqli error. Can you post your mysql version with this command:

mysql --version

Andre

Hi Andre,
mysql Ver 15.1 Distrib 10.4.7-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

The error about mysqli simply means that you haven’t installed PHP’s support for MySQL, probably a package called php-mysql or something similar.

I’m not sure where to look for that. However I checked back and the scripts I used did the install of PHP 7.2.
However if I now do php -v it returns
PHP 7.3.8-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug 7 2019 09:52:12) ( NTS )
So at least there is confusion about just what got installed and what didn’t. How to get out of that cleanly?

Brian1,

Wait, is the problem that you can’t see php files?

Have you tried this? adding index.php

sudo nano /etc/apache2/mods-available/dir.conf

<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.cgi index.pl sudo index.xhtml index.htm
</IfModule>

sudo systemctl restart apache2

sudo systemctl status apache2

Andre

dir.conf was already existing but with some differences.
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
but I changed it for your version.
I then restarted apache2 and the status indicates it is running.
info.php is in var/www/html but localhost/info.php doesn’t see it and the apache2 error log reports
[php7:error] [pid 10211] [client 127.0.0.1:36340] script ‘/var/www/html/info.php’ not found or unable to stat
Yet Omeka IS seen by localhost/omeka yet dies immediately with the error Omeka fatal error: The Mysqli extension is required for this adapter but the extension is not loaded.\n\n Confirm that the information in your db.ini file is correct.

Brian1,

Please remove the sudo from inside the Directoryindex. That’s a typo…

Andre

I had wondered about that, however as a newbie I try not to be surprised.
Before doing that however, between yesterdays morning test and the evening ‘something’ changed and I can now see localhost/info.php and no I have no idea what could have happened.
The PHD dump shows that it went to etc/php/7.3/apache2 for the php.ini which contains references to mysql.
Also apt-cache search php7.3 returns php7.3-mysql among others yet sudo php -m returns many modules but mysql or mysqli are not among them. Hence why localhost/omeka still has the same fail.

Brian1,

I want to make note that Omeka requires MySQL version 5.0 or greater. Can you try running this command again? Sounds like your package is missing something. Lets cover all bases.

sudo apt-get update && sudo apt-get upgrade

sudo apt-get install php-mysql
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb

I see that you are using MariaDB which should work just fine.

Andre

p.s. I am going to walk through the tutorial that you used to see if I can recreate the issue. https://websiteforstudents.com/install-omeka-classic-cms-on-ubuntu-16-04-17-10-18-04-with-apache2-mariadb-and-php-7-2/

Andre
Here are comments and terminal ouputs as it went through the processes

sudo apt-get update && sudo apt-get upgrade
During this process I noticed that 7.3 was flagged as not needed and the script went ahead and installed 7.2…

Calculating upgrade... Done
The following package was automatically installed and is no longer required:
php7.3
Use 'sudo apt autoremove' to remove it.

sudo apt-get install php-mysql
In here it seemed to be back into 7.3??

The following package was automatically installed and is no longer required:php7.3
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:php7.3-mysql
The following NEW packages will be installed: php-mysql php7.3-mysql
......
>sudo apt-get install mysql-server
This did not go well at all.  First I was a bit surprised to see it removing Mariadb. Then there was some foreshadowing of problems to come:...

dpkg: warning: while removing mariadb-server-core-10.4, directory ‘/usr/share/mysql’ not empty so not removed

and then it blew up with a popup warning and

Preparing to unpack …/mysql-server-5.7_5.7.27-0ubuntu0.18.04.1_amd64.deb Downgrade from (at least) 10.4 to 5.7 is not possible.
Packaging maintenance of MySQL will stop and the daemon disabled to prevent damage to your system.
For help, see /etc/mysql/FROZEN

So I stopped there.

Brian,

Sorry about the problem that you are having all after adding a Neatline plugin. I don’t think we need to rebuild Ubuntu. We might have to remove and replace some packages.

Can you share the Ubuntu version? Here is what I am running.

Release

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Kernel:

uname -a

Linux wolfgang 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Ubuntu Support Status:

ubuntu-support-status

Support status summary of ‘wolfgang’:

You have 1744 packages (94.3%) supported until April 2023 (Canonical - 5y)
You have 50 packages (2.7%) supported until April 2021 (Community - 3y)
You have 3 packages (0.2%) supported until April 2021 (Canonical - 3y)

You have 0 packages (0.0%) that can not/no-longer be downloaded
You have 52 packages (2.8%) that are unsupported

Autoremove

sudo apt-get autoremove

PHP version (I think you said 7.3)

php --version

PHP 7.2.19-0ubuntu0.18.04.1 (cli) (built: Jun 4 2019 14:48:12) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.2.19-0ubuntu0.18.04.1, Copyright © 1999-2018, by Zend Technologies

Lets see whats installed PHP

php -ini | grep mysql

Additional .ini files parsed => /etc/php/7.2/cli/conf.d/10-mysqlnd.ini,
/etc/php/7.2/cli/conf.d/20-mysqli.ini,
/etc/php/7.2/cli/conf.d/20-pdo_mysql.ini,
mysqli
Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql
mysqlnd statistics =>
PDO drivers => mysql
pdo_mysql
Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock

Lets see what you have and we can continue troubleshooting! We are improving your system requirements to properly run Omeka again . Anyone else in the community be sure to chime in. Brian1 is counting on our help!

Andre

OK here it is
l sb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 18.04.3 LTS

Release: 18.04

Codename: bionic

uname -a

Linux PCPHBM4 5.0.0-23-generic #24~18.04.1-Ubuntu SMP Mon Jul 29 16:12:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

ubuntu-support-status

Support status summary of ‘PCPHBM4’:

You have 1630 packages (93.6%) supported until avril 2023 (Canonical - 5y)

You have 55 packages (3.2%) supported until avril 2021 (Community - 3y)

You have 3 packages (0.2%) supported until avril 2021 (Canonical - 3y)

You have 0 packages (0.0%) that can not/no-longer be downloaded

You have 54 packages (3.1%) that are unsupported

Your Hardware Enablement Stack (HWE) is supported until avril 2023.

Run with --show-unsupported, --show-supported or --show-all to see more details

sudo apt-get autoremove

[sudo] password for brian:

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following packages will be REMOVED:

galera-4 libdbd-mysql-perl libdbi-perl libmysqlclient20 libterm-readkey-perl php7.3 socat

0 upgraded, 0 newly installed, 7 to remove and 0 not upgraded.

After this operation, 53,5 MB disk space will be freed.

Do you want to continue? [Y/n] n (I left them, might be evidence)

Abort.

php --version

PHP 7.3.8-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug 7 2019 09:52:12) ( NTS )

Copyright © 1997-2018 The PHP Group

Zend Engine v3.3.8, Copyright © 1998-2018 Zend Technologies

with Zend OPcache v7.3.8-1+ubuntu18.04.1+deb.sury.org+1, Copyright © 1999-2018, by Zend Technologies

php -ini | grep mysql

Additional .ini files parsed => /etc/php/7.3/cli/conf.d/10-mysqlnd.ini,

/etc/php/7.3/cli/conf.d/20-mysqli.ini,

/etc/php/7.3/cli/conf.d/20-pdo_mysql.ini,

mysqli

Client API library version => mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $

mysqli.allow_local_infile => Off => Off

mysqli.allow_persistent => On => On

mysqli.default_host => no value => no value

mysqli.default_port => 3306 => 3306

mysqli.default_pw => no value => no value

mysqli.default_socket => no value => no value

mysqli.default_user => no value => no value

mysqli.max_links => Unlimited => Unlimited

mysqli.max_persistent => Unlimited => Unlimited

mysqli.reconnect => Off => Off

mysqli.rollback_on_cached_plink => Off => Off

mysqlnd

mysqlnd => enabled

Version => mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $

Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password

API Extensions => mysqli,pdo_mysql

mysqlnd statistics =>

PDO drivers => mysql

pdo_mysql

Client API version => mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $

pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock

Brian1,

Can you create a new database and point Omeka 2.7 to it?

Andre

No I can’t. Attempts to mysql -u root -p
returned
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
and if i look with Nautilus at var/run/mysqld the folder is empty
cheers
Brian

Your (major) problem at the moment is the switch from MariaDB to MySQL, the result of trying to install mysql-server. Probably installing MariaDB again (I assume that’s mariadb-server but I don’t really know the Ubuntu package names) will allow the server to work again.

Brian1,

Looks like mysql did not start. Can you try this:

sudo /etc/init.d/mysql start

Should see this:

  • Starting MySQL database server mysqld No directory, logging in with HOME=/

Then

sudo mysql -u root -p

the initial password is “root”

Let me know if you make progress with this…

With things going steadily downhill I cut my losses, googled everything i could find on fully removing a LAMP stack and did it. Then I rebuilt the stack following as best I could the various scripts (why isn’t there one by Omeka?)
along the way I had forgotten to set mod rewrite and then I needed php-dom but by the end Mariadb, php 2.7 and apache2 are all alive and working and Omeka lets me in to set up the superuser and I start to look for plugins. At that point Firefox freezes and I reboot. So here we are again, this at least is reproducible but now I have a better chance of finding out why.
What happens is that Omeka dies because of a database error which I trace back to maria db failing to start with a timeout .
so then journalctl -xe reveals that
audit[3222]: AVC apparmor=“DENIED” operation=“sendmsg” info=“Failed name lookup - disconnected path” error=-13 profile="/usr/s
kernel: audit: type=1400 audit(1566114468.197:65): apparmor=“DENIED” operation=“sendmsg” info="Failed name lookup - disconnect
kernel: audit: type=1400 audit(1566114468.197:66): apparmor=“DENIED” operation=“sendmsg” info="Failed name lookup - disconnect
systemd[1]: mariadb.service: Failed with result ‘timeout’.

Trying to get back into mysql with sudo fails with
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

which is not surprising since var/run/mysqld folder is empty!

yet before reboot everything was working happily. What now?

Ubuntu 18.04 Lts, Omeka Classic 2.7 xampp-linux-x64-7.3.8-2

Following failures to establish a lampp stack manually I cleaned out the existing stack and tried doing it with XAMPP since this is for a stand alone development site on localhost only.

Following https://vitux.com/how-to-install-xampp-on-your-ubuntu-18-04-lts-system/

I installed the stack from xampp-linux-x64-7.3.8-2-installer.run

and soon http://localhost/dashboard/ is up and running.

Then to integrate omeka I follow https://libguides.gc.cuny.edu/c.php?g=405353&p=2759731 as far as it goes.

But it’s not far enough so from there to myphpadmin to create a database and omeka_user and set the privileges.

Check that the user credentials and db.ini details match. Stop and start Xampp.
Then opening localhost/omeka-2.7/ fails with:

``

Omeka fatal error: Zend_Exception: File “Zend/Db/Adapter/Mysqli.php” does not exist or class “Zend_Db_Adapter_Mysqli” was not found in the file in /opt/lampp/htdocs/omeka-2.7/application/libraries/Zend/Loader.php:87
Stack trace:
#0 /opt/lampp/htdocs/omeka-2.7/application/libraries/Zend/Db.php(263): Zend_Loader::loadClass(‘Zend_Db_Adapter…’)
#1 /opt/lampp/htdocs/omeka-2.7/application/libraries/Omeka/Application/Resource/Db.php(62): Zend_Db::factory(‘Mysqli’, Array)

and Google seems to know very little about it.

All I can see is that

/opt/lampp/htdocs/omeka-2.7/application/libraries Zend/ doesn’t have a Loader.php, it has an Autoloader.php

and Zend/Db/Adapter doesn’t have a Mysql.php

Looks like an integration step was missed, but what?