Why every time create a folder or file after they are locked

why every time I create a folder with into files (by script in php) after they are locked?

not always but nearly...

censto 7
apache 2.4
mariadb 10
php 7.1.5
owncloud 10.0.0

in add, owncloud is slow with version 10.0.0... maybe have I to install redis?
Do I resolve the locked files and the slowness?

What do you mean when you say owncloud is slow? Which part of using owncloud is slow and please specify some timings to help understand what the issue could be here.

Redis is the recommended service to use for file locking so I would suggest configuring this and see if the problem persists.

by redis the locked issue is resolved, but owc 10.0.2 is slow when "checking for update" in client app.

Can you try running a file:scan for the user that is affected by this issue? Also can you checkout the query log on your database to show the queries that are running a lot and maybe taking a long time to complete.