I am afraid that this is impossible. The only reference to fsyncthe sources is the implementation of the operation flushfor regular file system streams, and just to explicitly say that they are not synchronized, just by calling fflush.
If you really need it, you need to do it in the PHP extension.
source
share