extensions_custom.conf isn't part of Asterisk. It's included in extensions.conf by FreePBX.
You cannot reference a PHP file directly from extensions.conf. You need to use an application. Depending on the application used, the I/O in the script will either be over sockets or pipes. From a broken pipe point of view, there is no real difference.
For example, AGI will use a pipe and FastAGI will use network sockets.