I am using CakePhp 2.8.5 and I have a following configuration in database.php
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Sqlite',
'persistent' => false,
'database' => 'MyDB.sqlite3',
//'encoding' => 'utf8',
);
public $test = array(
'datasource' => 'Database/Sqlite',
'persistent' => false,
'database' => 'MyDB-test.sqlite3',
//'encoding' => 'utf8',
);
}
My sqlite database files are on the root folder of my cakephp web app.
Both the sqlite file have read/write/execute permission for everyone.
My Php.ini file configuration has PDO extension enabled for sqlite.
I am able to connect to sqlite3 database using my CakePHP internal web server using following command on MAC OS X 10.11.5 terminal : ./lib/Cake/Console/cake server -p 8080
But when I try to run it on my XAMPP server on MAC OS X using the web app configured in vhost.conf as below, it fails to connect to sqlite3 db.
<VirtualHost *:80>
ServerName cakeapp
DocumentRoot "/Users/userXXX/website/cakeapp"
<Directory "/Users/userXXX/website/cakeapp">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride all
Require all granted
</Directory>
ErrorLog "/Users/userXXX/website/cakeapp/error.log"
</VirtualHost>
However, I am getting following error message when I connect to cakephp web app on my local apache http server (cakeapp/):
CakePHP is NOT able to connect to the database.
Database connection "Sqlite" is missing, or could not be created.
So why does it works when I connect to cakeapp using internal http server ( localhost:8080) and does not work when I try to connect to it from my localhost default apache web server in XAMPP?