lundi 28 mars 2016

How do I install sqlite on Laravel 5 for WAMP?

I'm using Laravel 5 on my WAMP Server and I am trying to get sqlite to work on it so I can follow the tutorials properly. I've uncommented the following in php.ini and restarted the WAMP server.

  • extension=php_pdo_sqlite.dll
  • extension=php_sqlite.dll
  • extension=php_sqlite3.dll

After restarting the server, I've created a script to test if sqlite3 is supported or not located in C:\wamp2\www\laravel\test\test.php, and when I run it, the message says 'SQLite 3 supported.' So I know that it is working as far as that is concerned.

<?php
$dbname='base';
if(!class_exists('SQLite3'))
  die("SQLite 3 NOT supported.");

$base=new SQLite3($dbname, 0666);
echo "SQLite 3 supported."; 
?>

However, when I go into my database.php at: C:\wamp2\www\laravel\test\config\database.php and change the default to,

'default' => 'sqlite',

and then go into the cmd prompt to run the same command they do in the tutorial, which was: "C:\wamp2\www\laravel\test>sqlite3"

I get the error message

'sqlite3' is not recognized as an internal or external command, operable program or batch file.

In git it says:

Joe@JOEALAI /C/wamp2/www/laravel/test
$ sqlite3
sh: sqlite3: command not found

When my default was at 'mysql', it ran perfectly and I was able to connect and create tables no problem.

I am completely stuck. Is there anyone that has had this experience and can help me through this?

Aucun commentaire:

Enregistrer un commentaire