0
I’m having problem with initializing the Sqlite database when I run the command migrate
error appears like this
[PDOException]
SQLSTATE[HY000] [14] unable to open database file
My file .sqlite
is located in the Storage folder and its name is database.sqlite
.
In my configuration file it looks like this:
'sqlite' => [
'driver' => 'sqlite',
'database' => storage_path().'/database.sqlite',
'prefix' => '',
]
I don’t know what’s going on.
MY OPERATING SYSTEM IS WINDOWS
Is your environment windows or linux? If it’s linux try checking the sqlite file permissions.
– Celso Marigo Jr
my environment is windows
– Renan Rodrigues
@Renanrodrigues tries to put two instead of /, only as a test.
– Wallace Maxters
@Wallacemaxters still yes it didn’t work
– Renan Rodrigues
@Renanrodrigues make a test. Type
php artisan tinker
in the folder of the terminal, by the command line. When you open Tinker, typefile_exists(storage_path().'/database.sqlite')
to test if the file really exists. If it exists, test withis_writable
oris_readable
.– Wallace Maxters
both tests gave as true
– Renan Rodrigues
@Renanrodrigues now do another test. Put all these above codes inside a file
public/temp.php
. And accesstemp.php
in its url. The way apache reads permissions may be different (of course, if Windows has the same permission issues as Linux). If this is the case (and if possible), delete the file and create another one, to see if it solves the situation.– Wallace Maxters
What has to be the return ? Because he showed me on the screen the 3 commands
– Renan Rodrigues
I created the file with touch, is that why ?
– Renan Rodrigues
decobri, was missing a sqlite drive in my ide, do not know why kkkk
– Renan Rodrigues
I lie I think not kkk
– Renan Rodrigues
It really didn’t work
– Renan Rodrigues
The file is in the folder
app/storage/
or in a subfolder?– Guilherme Nascimento
@Guilhermenascimento is in app/Storage folder
– Renan Rodrigues
@Renanrodrigues this
storage_path('database.sqlite')
didn’t work, did it? If you put this in a controllerreturn storage_path('database.sqlite');
and point to a route, which Laravel prints?– Guilherme Nascimento
only minute to test
– Renan Rodrigues
The path of my file to the right, actually I think the problem is with permission, however I tried to give permission by windows and it does not work, and I used commands and also nothing happens
– Renan Rodrigues