ccovey / odbc-driver

Laravel 4 ODBC Driver
28 stars 48 forks source link

Getting "the requested PHP extension pdo-odbc is missing from your system" on composer update #17

Open ch0wnag3 opened 9 years ago

ch0wnag3 commented 9 years ago

Apologies if this is just user error, but at this point I'm just spinning my wheels. I'm basically getting the same error as the fellow here:

http://stackoverflow.com/questions/22838307/laravel-4-odbc-class-cannot-find-php-extension

I've verified that the extension is loaded on my system by doing a phpinfo() page and php -m. I'm wondering if this could be something as simple a casing issue. My reasoning is that the extension's name show us as PDO_ODBC in both places.

Change this:

    "require": {
        ...
        "ext-pdo_odbc": "*"
    },

To this:

    "require": {
        ...
        "ext-PDO_ODBC": "*"
    },

I'm sure there's a way to test this locally, but until I figure that out, I thought I'd ask here. Thanks in advance for taking the time to read this!

wstaples commented 9 years ago

Hi ch0wnag3, What environment are you using? (OS, Laravel Version, 32 or 64 bit ach..)

ch0wnag3 commented 9 years ago

Sorry for the late reply. Here are my environment details:

I'm still very new to Laravel development so if I'm omitting something you need please just let me know.

absentdream commented 9 years ago

i had issues with this and Laravel 4.2 downgrading to 4.1 works. sounds like extension was renamed in different version

gsisso commented 9 years ago

this extension is working on laravel 4.2 as well, im using this - https://github.com/wajatimur/odbc-driver

I dont have any issues,it might have 1 issue with the grammer[namespace issue] part but it is very easy to fix.

JordanDalton commented 9 years ago

gsplash, when you installed the wajatimur/odbc-driver did you run into a "Cannot instantiate abstract class Illuminate\Database\Schema\Grammars\Grammar " error? If so, what did you do to fix it?

gsisso commented 9 years ago

Yes I think I had that issue any how thats my odbc connection class -

<?php namespace Foundation\Database\Driver;

use Illuminate\Database\Connection;

class ODBCDriverConnection extends Connection { /* * @return Query\Grammars\Grammar / protected function getDefaultQueryGrammar() { $grammarConfig = $this->getGrammarConfig();

    if ($grammarConfig) {
        $packageGrammar = "Illuminate\\Database" . $grammarConfig;
        if (class_exists($packageGrammar)) {
            return $this->withTablePrefix(new $packageGrammar);
        }

        $illuminateGrammar = "Illuminate\\Database\\Query\\Grammars\\" . $grammarConfig;
        if (class_exists($illuminateGrammar)) {
            return $this->withTablePrefix(new $illuminateGrammar);

        }
    }

    return $this->withTablePrefix(new \Illuminate\Database\Query\Grammars\Grammar);
}

/**
 * Default grammar for specified Schema
 * @return Schema\Grammars\Grammar
 */
protected function getDefaultSchemaGrammar()
{
    $grammarConfig = $this->getGrammarConfig();
    if ($grammarConfig) {
        $packageGrammar = "Illuminate\\Database" . $grammarConfig;
        if (class_exists($packageGrammar)) {
            return $this->withTablePrefix(new $packageGrammar);
        }

        $illuminateGrammar = "Illuminate\\Database\\Schema\\Grammars\\" . $grammarConfig;
        if (class_exists($illuminateGrammar)) {
            return $this->withTablePrefix(new $illuminateGrammar);
        }
    }
}

protected function getGrammarConfig()
{
    if ($this->getConfig('grammar')) {
        return $this->getConfig('grammar');
    }

    return false;
}

}

I know its not perfect but was really annoyed by that class so I just left it like that when I got no errors