The difference between include()
and require()
arises when the file being included cannot be found: include()
will release a warning (E_WARNING) and the script will continue, whereas require()
will release a fatal error (E_COMPILE_ERROR) and terminate the script. If the file being included is critical to the rest of the script running correctly then you need to use require()
.
For more details : Difference between Include and Require in PHP