K
K
kreativ_252019-04-30 23:25:42
PHP
kreativ_25, 2019-04-30 23:25:42

Folder/file permissions for php script in windows server 2016?

I encountered an unexpected problem on windows server 2016.
It is necessary to select data from databases created in access and write to the corresponding tables in MySQL.
It is necessary to process about 10 access bases.
I wrote scripts in php 7. I
set a task in the windows server event manager to execute the script in the terminal and the interval for bypassing the first access base - everything works fine.
I set the same in the event manager for another access database, which is located in the same folder, it gives an error there is no access to the access database.
The databases are located on the same disk of windows server 2016, the folder with the databases is shared for work by employees of other departments.
If you copy the access database to any other folder on a disk that is not shared, everything works fine.
--------------
To establish a connection with the access database, I parse the path of finding the database using realpath ().
And so in the same folder on the first DB canonicalizes a way, on the second - false.
Once again I repeat - if the second database is rewritten to another unshared folder - everything works fine. But this option is absolutely not suitable - it is necessary that the bases be shared, otherwise the whole point disappears.
---------------
I tried to look at the permissions on the folders :
if you look at the shared folder - it gives out 0555 (it is possible to connect to only one database)
if you look at a regular folder - it gives 0777
--------------
PHP gives an error SQL state S1000 in SQLConnect in
--------------
When accessing the first database, I close connection ( odbc_connect )
there is no connection and still does not work.
I have only one option left - this is a problem with access rights. Because even realpath() says "The script being run must have run rights on all directories in the checked hierarchy, otherwise realpath() will return FALSE".
Who may have encountered similar problems.
How did you decide?
Please share your experience.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
webku, 2019-05-01
@kreativ_25

folder security tab add users IUSR, IIS_IUSR and give them read and write permissions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question