My system configuration Installed Ubuntu 14.04 + XAMPP + Laravel 4
The mysql driver is configured on /opt/lampp/htdocs/larva/app/config/database.php
'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'db_larva', 'username' => 'root', 'password' => '*****', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => 'tbl_', ),
PDO extension is enabled on /opt/lampp/etc/php.ini
extension=php_pdo_mysql.dll
create a table using
php artisan migrate:make create_users --create=users
which generate 2014_10_02_114459_create_users.php
php artisan migrate:make create_orders --create=orders
create 2014_10_02_054103_create_orders.php
now on the terminal what i did
cd /opt/lampp/htdocs/larva/ php artisan migrate
he gives an error
[PDOException] could not find driver
when i started
php artisan migrate --database=db_larva
he gives another error again
[InvalidArgumentException]
Database [db_larva] is not configured.
Please tell me what am I doing wrong?
My suggestion:
Is the place right? do php artisan inside root folder?
The default table structure inside function up() needs to be written one more code, there may be db connection settings
- difference between
php artisan migrate:make create_users --create=users and php artisan migrate:make create_users --create --table=users - I also need to configure the database settings elsewhere. Table prefix
- may be problematic.
I am not writing a single line to connect a database anywhere else in the code. where to write a message in code, or is it a later stage?
php --ini gives another php ini path?
Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Additional .ini files parsed: /etc/php5/cli/conf.d/05-opcache.ini, /etc/php5/cli/conf.d/10-pdo.ini, /etc/php5/cli/conf.d/20-json.ini, /etc/php5/cli/conf.d/20-mcrypt.ini, /etc/php5/cli/conf.d/20-readline.ini, /etc/php5/cli/conf.d/20-xdebug.ini
source share