0

I have an application responsible for the URL Routing of my other projects I developed while under Windows environment.

Now that I have a Linux environment, set in a Virtual Machine, and I can't regenerate the routes of my applications because the SQLite file I use to store the informations apparently cannot be written by the routines in my PHP applications.

I'm receiving a PDOException with the following message:

SQLSTATE[HY000]: General error: 8 attempt to write a readonly database

I've read this stack saying the parent folder of the SQLite file must be writable too. Well... I'm new in the Linux world and I'm solving several small problems one at a time and although I understand this... restrictive policy Linux has/have, I don't know how to fix this.

The Windows partition where the files are being stored, accordingly to the tutorials I've read in order to allow them to be accessed within the guest (Linux), show me I'm the owner:

Folder Permissions

And I've read PHP scripts run with a different user or group. What should I do?

Sigh... I'm getting angry with this Linux environment...

Community
  • 1
  • 1
  • Can you write (create) files in the Windows partition via the console? – Alejandro Arbiza Oct 11 '14 at 19:24
  • Yes, and I think I can because the Terminal says **bruno@pc**. I tried with 3rd-party applications like Sqliteman and it can't write the file too, saying the file is locked. –  Oct 11 '14 at 19:31
  • My guess is that this is a permissions issue in the mounted partition. Which Linux are you using? – Alejandro Arbiza Oct 11 '14 at 20:03
  • Linux Mint 17. Accordingly to the tutorial I should add this line to **/etc/fstab**: `//192.168.0.13/WindosPartitionName /mnt/share/FolderName cifs username=bruno,password=mypassword,rw,uid=1000,gid=1000 0 0`. Another source said if I change both 1000 to 0 (zero) instead of me the owner would be root. –  Oct 11 '14 at 20:08
  • Have you tried adding the parameters `file_mode` and `dir_mode` as shown here: http://community.linuxmint.com/tutorial/view/77 ? – Alejandro Arbiza Oct 11 '14 at 20:23
  • Well, I've added the extra params and at least the original error is not appearing anymore. However, now `I'm receiving `SQLSTATE[HY000]: General error: 5 database is locked`. And maybe because of this error I noticed the routine is taking too long to complete, even to show the error. And this is usually very fast. –  Oct 11 '14 at 20:39
  • Would that be this error now then? http://stackoverflow.com/questions/8559623/sqlite-busy-the-database-file-is-locked-database-is-locked-in-wicket – Alejandro Arbiza Oct 11 '14 at 23:54
  • This *might* be the case because if try to add the routing entry manually in the database using Sqliteman, when I try to commit this new entry, it also reports that the database is locked but it tells me that there is another operation going on. But I have no clue on what to do and, again, this is happening only in the Linux environment. –  Oct 12 '14 at 00:48
  • I'm sorry Bruno, I'm blank here. I still think that the problem is related to permissions... when you run Sqliteman: do you do it via sudo? – Alejandro Arbiza Oct 12 '14 at 13:10

0 Answers0