As already stated in the comments, PHP is not the ideal language for facial recognition itself.
However, as you will develop a web service, it is interesting to think of PHP as the web application that will receive the photos, from the reception of the same, you connect with a service or with another language that will make the recognition properly said.
The very task of recognizing faces from images is not trivial - you need a database of images, develop a neural network, train it there then, if all goes well, put together a set of attributes common to each set of photos of the same person.
Obviously this also depends very much on your requirements: if you need to find identical images to the ones that currently exist (which I find difficult, since they will come from photos taken by webcams) or with a certain degree of similarity.