If the 404 error page is generated in PHP, then it might be the problem you mentioned, if the 404 error page is LSWS' default error page, the php script has not been reached at all.
Turn on debug logging by set "Debug Level" to "HIGH" under "Server"->"log" tab, you should be able to get some...