compose version 3 is not meant to be used with host volumes, more with distributed volumes.
in your first case, with simple sharing, you just need to explicit define a named volume and use this volume in your php as well as in your web service.
if you then explicit need that this named volume is written to your local host, you can use the driver local-persist.
Named volumes are the way to go. Host mounting creates an undesirable coupling which severely limits the ability of your scheduler to locate containers (even when that scheduler is you). For obvious reasons stateless containers are preferable, but of course in reality we do need to deal with application persistent storage. If you can do that off a physical host, either using a network storage driver or a database, then the life-cycle of your containerised estate will become infinitely easier to manage.