0

I am trying to perform artisan migrate. I have installed odbc-driver and connection is set successfully because I can read from db. The problem is that I cant create tables with php artisan migrate. I have enable odbc at php.ini. The error is like below:

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Ccovey\\ODBCDriver\\Schema\\Grammars\\Sq
lServerGrammar' not found","file":"C:\\wamp\\www\\license3\\vendor\\ccovey\\odbc-driver-l4\\src\\Ccovey\\ODBCDriver\\ODBCDriverConnecti
on.php","line":36}}

this is my ODBCDriverConnection class:

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

        if ($grammarConfig) {
            $packageGrammar = "Ccovey\\ODBCDriver\\Grammars\\" . $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 Grammar);
    }

    /**
     * Default grammar for specified Schema
     * @return Schema\Grammars\Grammar
     */
    protected function getDefaultSchemaGrammar()
    {
        return $this->withTablePrefix(new Schema\Grammars\SqlServerGrammar);
    }

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

        return false;
    }
}
arual
  • 279
  • 1
  • 5
  • 14
  • @user3158900 why do u think that wamp has to do with this? – arual Dec 12 '14 at 13:30
  • WAMP uses a different php.ini for the webserver and for the command line. If you can access data on the site but you can't run migrations via command line, you probably have to also modify the php.ini which would be in the php directory `wamp\bin\php\php[version]\php.ini`. The error in question though looks like it just can't find a class. Try using `composer dump` as well. – user1669496 Dec 12 '14 at 13:48
  • @ user3158900 now i shows: CLI has stopped working. For a moment it generated the table but when tried to create another table now displays this error – arual Dec 12 '14 at 14:02
  • I have modiefied php.ini – arual Dec 12 '14 at 14:03
  • if you type `pvp -v` which version are you using and does it still give you the error? – user1669496 Dec 12 '14 at 14:37
  • @ user3158900 Yes it still shows the errror. pvp -v is not recognised as command – arual Dec 12 '14 at 15:09
  • php 5.5.12 if u mean php -v – arual Dec 12 '14 at 15:11

0 Answers0