Showing PHP resource usage
Posted by: Skybly
Posted on: 2005-08-23 15:45:00
I turned on resource logging for my site a while ago, but the reports have not been very useful so far, since all my php scripts simply show up as "php.cgi". So, I followed these Dreamhost-supplied instructions in the hopes of fixing the problem.
Unfortunately, I ran into the following two problems:
1. Trying to access any page with a .php ending now results in the following error message:
In reply to:Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
and a link to this page of the PHP manual.
Curiously, this only happens if the .php ending is visible in the URL - for example, accessing /folder/index.php does not work, but /folder/ does, even though they are the same file.
2. Even after this change, the resource logs don't provide any more insight than before - they now simply list "php" instead of "php.cgi", but no script name or anything.
I've already contacted support about the first issue, but the only suggestion I received was to "reverse the directions so they're running PHP as CGI again, and try to find a different way to see why is your usage so high. We just give pointers to find out about your script, but we are not able to figure it out for you." A bit disappointing since I did not ask for Dreamhost to figure anything out except why the instructions they supply do not work :(
So, I'm turning here in the hopes that another customer has gotten this to work and can maybe help me :) Thanks!