Error message during Omeka S install

OK so I went crazy and removed PHP5.4 and installed PHP5.6. I had to upgrade to httpd24 also. I removed Omeka-S and reinstalled it in the new /opt/rh/httpd24/root/var/www/html directory that httpd24 uses. I checked my Mariadb install and my database is there.

My php test.php is working fine from the /opt/rh/httpd24/root/var/www/html directory. I am getting an error: “Omeka S encountered an error” Not being afraid of vague errors messages, I quickly rushed to the logs directory to check the logs and beat this beast into submission with the information contained therein… Sadly my log files are empty and so I stand before you confused and hoping you guys have some suggestions.

My install has the following:
• RHEL 7
• httpd24 version 2.4.25-9
• MariaDB version 5.5.56-2
• PHP 5.6+ (latest stable version preferred, with PDO, pdo_mysql, and xml extensions installed)

I put it in development mode and got this:

Warning: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 43
Omeka S encountered an error

Zend\ServiceManager\Exception\ServiceNotCreatedException
Service with name “Omeka\ModuleManager” could not be created. Reason: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

Details:

exception ‘PDOException’ with message ‘SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct(‘mysql:host=loca…’, ‘user’, ‘password’, Array)
#1 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(45): Doctrine\DBAL\Driver\PDOConnection->__construct(‘mysql:host=loca…’, ‘user’, ‘password’, Array)
#2 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, ‘user’, ‘password’, Array)
#3 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(799): Doctrine\DBAL\Connection->connect()
#4 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Service/ModuleManagerFactory.php(95): Doctrine\DBAL\Connection->prepare(‘SELECT * FROM m…’)
#5 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(758): Omeka\Service\ModuleManagerFactory->__invoke(Object(Zend\ServiceManager\ServiceManager), ‘Omeka\ModuleMan…’, NULL)
#6 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate(‘Omeka\ModuleMan…’)
#7 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Mvc/Application.php(32): Zend\ServiceManager\ServiceManager->get(‘Omeka\ModuleMan…’)
#8 /opt/rh/httpd24/root/var/www/html/omeka-s/index.php(19): Omeka\Mvc\Application::init(Array)
#9 {main}

Next exception ‘Doctrine\DBAL\Driver\PDOException’ with message ‘SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:47
Stack trace:
#0 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(45): Doctrine\DBAL\Driver\PDOConnection::__construct(‘mysql:host=loca…’, ‘user’, ‘password’, Array)
#1 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, ‘user’, ‘password’, Array)
#2 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(799): Doctrine\DBAL\Connection->connect()
#3 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Service/ModuleManagerFactory.php(95): Doctrine\DBAL\Connection->prepare(‘SELECT * FROM m…’)
#4 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(758): Omeka\Service\ModuleManagerFactory->__invoke(Object(Zend\ServiceManager\ServiceManager), ‘Omeka\ModuleMan…’, NULL)
#5 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate(‘Omeka\ModuleMan…’)
#6 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Mvc/Application.php(32): Zend\ServiceManager\ServiceManager->get(‘Omeka\ModuleMan…’)
#7 /opt/rh/httpd24/root/var/www/html/omeka-s/index.php(19): Omeka\Mvc\Application::init(Array)
#8 {main}

Next exception ‘Doctrine\DBAL\Exception\ConnectionException’ with message ‘An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:103
Stack trace:
#0 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(145): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
#1 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(47): Doctrine\DBAL\DBALException::driverException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException))
#2 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, ‘user’, ‘password’, Array)
#3 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(799): Doctrine\DBAL\Connection->connect()
#4 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Service/ModuleManagerFactory.php(95): Doctrine\DBAL\Connection->prepare(‘SELECT * FROM m…’)
#5 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(758): Omeka\Service\ModuleManagerFactory->__invoke(Object(Zend\ServiceManager\ServiceManager), ‘Omeka\ModuleMan…’, NULL)
#6 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate(‘Omeka\ModuleMan…’)
#7 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Mvc/Application.php(32): Zend\ServiceManager\ServiceManager->get(‘Omeka\ModuleMan…’)
#8 /opt/rh/httpd24/root/var/www/html/omeka-s/index.php(19): Omeka\Mvc\Application::init(Array)
#9 {main}

Next exception ‘Zend\ServiceManager\Exception\ServiceNotCreatedException’ with message ‘Service with name “Omeka\ModuleManager” could not be created. Reason: An exception occured in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known’ in /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php:765
Stack trace:
#0 /opt/rh/httpd24/root/var/www/html/omeka-s/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate(‘Omeka\ModuleMan…’)
#1 /opt/rh/httpd24/root/var/www/html/omeka-s/application/src/Mvc/Application.php(32): Zend\ServiceManager\ServiceManager->get(‘Omeka\ModuleMan…’)
#2 /opt/rh/httpd24/root/var/www/html/omeka-s/index.php(19): Omeka\Mvc\Application::init(Array)
#3 {main}

I took a look at local.config.php and do not have values for phpcli_path (see below). Is that a clue?

<?php return [ 'logger' => [ 'log' => false, 'priority' => \Zend\Log\Logger::NOTICE, ], 'http_client' => [ 'sslcapath' => null, 'sslcafile' => null, ], 'cli' => [ 'phpcli_path' => null, ], 'thumbnails' => [ 'types' => [ 'large' => ['constraint' => 800], 'medium' => ['constraint' => 200], 'square' => ['constraint' => 200], ], 'thumbnailer_options' => [ 'imagemagick_dir' => null, ], ], 'translator' => [ 'locale' => 'en_US', ], 'service_manager' => [ 'aliases' => [ 'Omeka\File\Store' => 'Omeka\File\Store\Local', 'Omeka\File\Thumbnailer' => 'Omeka\File\Thumbnailer\ImageMagick', ], ], ]; Thanks, Rick

You have to set the details of your database in config/database.ini.

Thanks Daniel,

I do have that set properly. I changed the user name to user and password to password in the screen output before I posted it.

user = user
password = password
dbname = omekas_db
host = local_host
port = 81
;unix_socket =
;log_path =

local_host looks strange. Try to copy adminer (a simple php file) beside your test.php to check if the sql base is available from php.

I agree with Daniel: the issue here is your database configuration, and specifically the “host” line. The PHP error you’re seeing is that PHP tried to look up that hostname and was unable to. If you’re just using a local server, localhost as one word with no punctuation is the typical hostname. Otherwise, a domain name or IP address is usual.

Daniel, I don’t know anything about adminer. I did however place test.php in the omeka s directory and it displayed fine. You are right about the local_host being wrong. I changed it with no affect.

Something is wrong with the httpd24 / php configuration I think. I have been trying to get a list of the installed php mods but php -M doesn’t return anything. Would you know how to get a command line output that lists the loaded php mods?

Jflatnes, I tried both the dns name and ip address without any difference.

php -m (lowercase) will print the installed modules. With your situation with things under /opt though, you’d need to make sure the php you’re running is actually the newer one you installed.

Do you get the exact same error when you use the IP address for the host?

Another item of note, it’d be very odd to have mysql running on port 81. Everything in that file, including the port line, should be referring to mysql.

About adminer, you don’t have nothing about it: just copy the file “https://github.com/vrana/adminer/releases/download/v4.3.1/adminer-4.3.1.php” at the root of your Omeka S install, and go to it with your browser.