<s>[INST] I have a Lighttpd installation with PHP 5.6, and I am encountering issues with file uploads. I would like to monitor the file uploads, to see which stage a certain file is at.

Here are some potential stages I could be at:

1. The file cannot be chosen for upload
2. The file is being uploaded to the server, but hasn't arrive yet (submitted, not processed)
3. The file is being processed by PHP (uploaded, being processed)
4. The file was uploaded okay, but some handling or validation of it failed

Is there a way of adding logging, in order to track the file at these stages?[/INST]