Where is the main() method in the PHP interpreter source?
c, php
Solution
The `main()` functions in PHP are defined within the SAPI, as they are specific to the mode that PHP is being run in. For instance, for the command-line SAPI, it is defined in `sapi/cli/php_cli.c`; for the CGI/FastCGI SAPI, it is defined in `sapi/cgi/cgi_main.c`.
Some other SAPIs, such as the `apache2` SAPI, do not define a `main()` function at all, because they are only loaded as a module by a separate executable.
Problem
When I read the PHP source code written in C, I can't find the `main()` method; could somebody help me?