开发者

Internally which file/page wil be execute first in php

开发者 https://www.devze.com 2023-02-22 07:15 出处:网络
I am new to php, so i dont kn开发者_C百科ow the framework clearly. In PHP project/application which file/page will execute first.There\'s no first executed file or whatsoever. The php file you execute

I am new to php, so i dont kn开发者_C百科ow the framework clearly. In PHP project/application which file/page will execute first.


There's no first executed file or whatsoever. The php file you execute gets executed that's it. In web environment you execute a file by requesting the web server using a regular browser for example, when your browser doesn't specify a file name to execute (for example: http://some_address.com/file_to_execute.php) the web server usually assumes you're requesting the so called home page (ie. index.php) but this is just by design, the home page could even be home.php or whatever.php depending on your web server configuration.

Other than that, your question is murky and if this isn't the answer you're requesting, then re-work your question.


Usually either default.php or index.php depending on your server configuration.

But you can change it however you want: http://httpd.apache.org/docs/2.0/mod/directive-dict.html (on apache)


it's depend on the apache configuration which file should be executed when you enter url but do not defined the file name in url. Then the file named in the apache configuration will be executed.

The apache configuration file called httpd.conf

In this file there is a line called DirectoryIndex somefile.php someotherfile.php

That decide which file will be executed first.

If the somefile.php is not exists in the hierarchy of your directories then somotherfile.php will be exeucted.

These all are in the case when you did not defined the file name in the URL in the address bar of browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号