Installation - No such file or directory

I'm trying to install Omeka 1.0 on a Linux server running Redhat, with Mysql 5.0 and PHP 5.2.10.

When I initially load the install/index.php page, it tells me to setup the database configuration.

After I edit db.ini and re-load the page, it just says "No such file or directory".

I don't see any errors in the Apache logs.

I did some simple debugging with PHP print statements, and the message seems to be generated in the Installer.php checkMysqlVersion function, specifically the line that does:
$mysqlVersion = $db->getConnection()->getConnection()->server_info;

Any suggestions on what is wrong?

Thanks for pointing this out. That line uses getConnection(), which appears to be a deprecated function. In addition, getConnection is written twice, which is probably the main problem.

While you should never hack the core software, could you possibly try replacing editing some code on your system so we know if this patch works? Try replacing $mysqlVersion = $db->getConnection()->getConnection()->server_info; with 1$mysqlVersion = $db->getAdapter()->server_info;` and let us know if that fixes your problem.

If anyone is digging around the code, you may have noticed that the message checkMysqlVersion() prints with the minimum MySQL version was improperly printing the self::OMEKA_PHP_VERSION instead of OMEKA_MYSQL_VERSION. I'm commiting a fix to the trunk, and I'll merge it to the 1.0-stable branch.

Dave

it looks like my message got a little garbled..

try replacing that line with:

$mysqlVersion = $db->getAdapter()->server_info;

That helped a lot - now I get a message that MySQL 5.2 is required and that mod_rewrite needs to be enabled.

The pre-install notes only specify MySQL 5.0, so do I need to upgrade MySQL?

For mod_rewrite, phpinfo() shows it's loaded, but I need to double check with my sys admin, and I also noticed some other forum posts about this.

Try replacing the checkMysqlVersion function with the following code and let me know if this works:

private function checkMysqlVersion()
{
$db = $this->core->getDb();
$mysqlVersion = $db->getAdapter()->server_info;
if (version_compare($mysqlVersion, self::OMEKA_MYSQL_VERSION, '<')) {
$header = "Incorrect version of MySQL";
$msg = "Omeka requires MySQL " . self::OMEKA_MYSQL_VERSION . " or greater
to be installed. Instructions
for upgrading are on the MySQL website.";
$this->errors[] = compact('header', 'msg');
}
}

Still doesn't like the MySQL version, but the problem is that $mysqlVersion has a NULL value.

I wrote a quick PHP page to do mysqli_get_client_version and it reports:
Client lib version: 50005

The message now mentions MySQL 5.0.

right. the constant defined in the message "Omeka requires MySQL" is incorrect int he code-base.. it refers to the php version (5.2) instead of the mysql version (5.0). That wouldn't affect this though.

I was guessing about the original solution of:

$mysqlVersion = $db->getAdapter()->server_info;

try changing that to:

$mysqlVersion = $db->getAdapter()->getAdapter()->server_info;

I talked this through with John Flatness, and the following code should do the trick:

$mysqlVersion = $db->getAdapter()->getServerVersion();

Thanks for your help testing this!

That gets a fatal error:

Call to undefined method Zend_Db_Adapter_Mysqli::getAdapter() in /var/www/html/omeka/install/Installer.php on line 119

Looking at Mysqli, I saw a getServerVersion, but got a NULL value when I tried:
$mysqlVersion = $db->getAdapter()->getServerVersion;

Sorry - while making my last post I missed you last.

Here is the code I currently have:

private function checkMysqlVersion()
{
$db = $this->core->getDb();
$mysqlVersion = $db->getAdapter()->getServerVersion();
if (version_compare($mysqlVersion, self::OMEKA_MYSQL_VERSION, '<')) {

It gives a "No such file or directory" message on the "$mysqlVersion = ..." statement.

leaving the () off after getServerVersion, generates a NULL value for $mysqlVersion

Thanks for all of the help with this - I may not get back to it for a few days, but I still want to get it working.

Hi - finally getting back to this.

When I load the install/index.php page on my server, I get a message about an incorrect version of MySQL and mod_rewrite not being enabled.

I'm running MySQL 5.0, and phpinfo reports that the Apache mod_rewrite module is loaded.

At this point, I've followed the above suggestions, and made two updates to Installer.php - one to fix OMEKA_MYSQL_VERSION in the version_compare test, and the other to use:

$mysqlVersion = $db->getAdapter()->getServerVersion

To get the MySQL version.

If I add () after getServerVersion, I get a "No such file or directory" message.

Any suggestions?

It's less than ideal to continue posting large code snippets on the forums, and I'll warn users that may stumble upon this in the future that it may become irrelevant and unusable code for future releases of Omeka. I think this has been included in the code-base for an upcoming release.. in the meantime, try replacing the function checkMysqlVersion to a following code:

private function checkMysqlVersion()
    {
        $db = Omeka_Context::getInstance()->getDb();
        $mysqlVersion = $db->getAdapter()->getServerVersion();
        if (version_compare($mysqlVersion, self::OMEKA_MYSQL_VERSION, '<')) {
            $header = "Incorrect version of MySQL";
            $msg = "Omeka requires MySQL " . self::OMEKA_MYSQL_VERSION . " or greater
            to be installed.  <a href=\"http://dev.mysql.com/doc/refman/5.0/en/upgrade.html\">Instructions</a>
            for upgrading are on the MySQL website.</a>";
            $this->errors[] = compact('header', 'msg');
        }
    }

OK - it looks like this basically add a change to how the $db object is created.

Unfortunately, it's still not working. With the above code, I get a "No such file or directory" error on the line that sets $mysqlVersion. I'll note that if I remove the () from getServerVersion, the code gets past this line, but $mysqlVersion has a NULL value.

I'm wondering if I have a problem elsewhere in my PHP/MySQL install, but can't find any obvious problems.

To follow up on this, I got the install working on a desktop VM with slightly different versions of PHP and MySQL, also a 32-bit VM rather than 64-bit.

Re-built the server as 32-bit with matching PHP and MySQL and I was able to complete the Omeka install with no issues.

I'm not sure what the actual problem was, but it's working now. Thanks for the help.

Thanks for the update on this.