简体   繁体   中英

php - can I get every http request information come to any resource on my domain?

I want to get and log every request that come to any resource on my domain. I know how to get it if the requested resource is the php file. and that is by inserting the piece of code that will log the $_REQUEST information into every php file on my website, and save this information on a file or db..etc.

but I don't know how to know throw PHP if someone requested another resource (eg: images, js scripts,...etc).

1- Is there a PHP way to know if someone requested other resources than PHP files?

2- Is there a another way to log the requests to my php files better than inserting the logging code into every php file?

You can't do this from PHP if the execution does not go through the logger script . But luckily for you, Apache already saves all the access logs. Just search in the apache2.conf (or httpd.conf) file to see where are the access logs stored.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM