This question has previously been asked on the Super User forum.
Quoting from @grawity's answer on that question:
When you invoke a program via xargs, the program's stdin (standard input) points to /dev/null. (Since xargs doesn't know the original stdin, it does the next best thing.)
Vim expects its stdin to be the same as its controlling terminal, and performs various terminal-related ioctl's on stdin directly. When done on /dev/null (or any non-tty file descriptor), those ioctls are meaningless and return ENOTTY, which gets silently ignored.
Both the OS X/macOS/BSD and recent versions of GNU findutils' xargs (beginning with v4.6.0) have a -o option to address this exact scenario:
From the macOS/BSD man page:
-o Reopen stdin as /dev/tty in the child process before executing the command. This is useful if you want xargs to run an interactive application.
Hence, on macOS, you could use the following command:
find . -name "php.ini" | xargs -o vim
If you are stuck with an older version of GNU xargs, thisthe following command will work. (Make sure to include the dummy string, otherwise it will drop the first file.)
find . -name "php.ini" | xargs bash -c '</dev/tty vim "$@"' dummy
The above solutions are courtesy Jaime McGuigan on SuperUser. Adding them here for any future visitors searching the site for this error.