Been working on PHP for a year now, still not sure how PHP decides what is considered to be the entry point.
If I set my docroot to a '\project\www' directory, what file in that dir gets consumed as the entry? I assumed it was index.php, but I just deleted that file out of my project and I started getting redirected elsewhere.
PHP doesn't decide anything. You, as website visitor, are making that decision when you click on a link or type a URL in the browser's location bar. If the response contains HTML, the resources contained in the document will eventually trigger the rest of requests:
GET https://stackoverflow.com/questions/70624361/how-does-one-determine-the-entry-point-for-a-php-project
GET https://fonts.gstatic.com/s/robotoslab/v16/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISmb2Rm.ttf
POST https://stackoverflow.com/posts/validate-body
...
The target server will have an HTTP server program running, or the request will time out without response. Such software (Apache, IIS, Nginx, CloudFront...) needs to be configured so it knows how to handle the request. Some possible options include:
It's usually a combination of several features.
The PHP interpreter can be running as web server module, be invoked from disk or be running all the time as network process. Eventually, the PHP interpreter receives a request (not all requests to server are typically meant to be processed as PHP) with this information:
PHP handles the request, executes the appropriate PHP code and emits its response.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.