简体   繁体   中英

PHP Executing Multiple Times

I've got a standard LAMP setup on my machine. This morning, it started executing scripts multiple times.

For instance, in the code:

log_message('error', "here be a message ".rand()); exit;

My log file is recording TWO log messages with a different random number, despite there being an exit in the script. I've not had this before and a little bit stumped. Can anyone give me any clues as to why this might be happening?

If you're rewriting URLs a common issue can be the browser requesting /favicon.ico , which causes a second request. The simplest way to check this is to temporarily add the REQUEST_URI to your log line:

log_message('error', "{$_SERVER['REQUEST_URI']} - here be a message ".rand());
exit;

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