AndroidHV
AndroidHV

Reputation: 369

handling access permissions of a folder containing SQLite database on Apache server

I have an Apache server
I have several SQLite databases there I have a PHP code there I have an Android application which communicates with that PHP code (http post)

The PHP code gets data from the Android application and creates SQLite databases or write records there or read and so on
So the complete control over SQLite databases is with that PHP code

Now the questions are as following:

1 - Considering the file-folder access permissions, what is the PHP code called,
owner or group or world ?

2 - Is it a true structure that all users interact with that PHP code and whenever an Android user is working with the SQLite database of the server, that PHP code gives Write-Read access to the folder containing the SQLite database?

3 - Isn't there any conflict considering one user may give write access to the folder containing the SQLite database and one other user which previously had given write access has now finished the work and gives read access to the folder? while the first user needs write access yet and the other user has now changed it to read access?

4 - Isn't there any security issue if I generally give Read and Write access to the folder containing the SQLite database (Since the PHP code controls everything and I have the PHP code in non public html folder of the server)

Upvotes: 0

Views: 605

Answers (1)

Honk der Hase
Honk der Hase

Reputation: 2488

PHP runs through a webserver, the webserver runs under a user account, access to the servers file system (usually linux) is restricted to users/groups.

So, access to a folder/file must be possible for the user account (on that server) who is running the webserver process (which is running the PHP executable).

The SQLite file should NOT be accessible from the web.

It's not that access rights are changed by the PHP process according to web-users making a request. You should make yourself familiar with how the web actually works...

Upvotes: 1

Related Questions