migration is okay but I got POE exception error when I view the webpage
Ubuntu 14.04.2 Laravel 4.2.0 PDOException could not find driver MySQL
I want Laravel 4.2.0 working on my Ubuntu 14.04.2 LTS Server.
What I have done until now:
-
Installing Ubuntu 14.04.2
-
sudo apt-get install apache2 -
sudo apt-get install mysql-server -
Install Openssl
-
Install libmcrypt
-
Install PHP by
./configure --with-openssl --with-mcrypt --enable-mbstring --with-pdo-mysql --enable-pdo --with-mysqlmake make install
-
Download Laravel 4.2.0 zip file from GitHub, unzip and transfer it through WinSCP
-
Install Laravel 4.2.0 by
curl -sS https://getcomposer.org/installer | php php composer.phar install -
Database connection by configuring /app/config/database.php
'mysql' => array( 'driver' => 'mysql', 'host' => 'localhost', 'database' => 'laravel', 'username' => 'laravel-user', 'password' => '************', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ),
And I got this error.
PDOException
could not find driver
Open: /var/www/laravel/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php
*/
public function createConnection($dsn, array $config, array $options)
{
$username = array_get($config, 'username');
$password = array_get($config, 'password');
return new PDO($dsn, $username, $password, $options);
}
I don't know what to do. I have googled for a day, and got no answer. Please help me.
I checked theres PDO enabled with php -i|grep PDO command.
Result:
PDO support => enabled
PDO drivers => sqlite, mysql
PDO Drivers for MySQL => enabled
PDO Drivers for SQLite 3.x => enabled
But I checked php.ini, there's no line like extension=pdo.so So I added the lines like this
[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict
;pdo_odbc.db2_instance_name
[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=
extension=pdo.so
extension=pdo_sqlite.so
extension=sqlite.so
Please help me out of this frustrating situation.. Thank you in advance for helping me.
Please or to participate in this conversation.