1

How do I determine how our php files are being rendered in a simple LAMP configuration?

phpinfo shows:

-- Configure Command --
--enable-force-cgi-redirect
--enable-fastcgi

-- Server API --
CGI/FastCGI

-- cgi-fcgi --
Directive               Local Value Master Value
cgi.check_shebang_line  1  1
cgi.fix_pathinfo     1  1
cgi.force_redirect      1  1
cgi.nph                 0  0
cgi.redirect_status_env no value no value
cgi.rfc2616_headers     0  0
fastcgi.logging         1  1
Chris Williams
  • 265
  • 2
  • 5
  • 14

2 Answers2

2

If you have shell access to the server (or can fake it) you may to be able to look at the apache config (or other httpd) or the process table (fcgid) for hints.

It's also possible that shell php (cli) and web php (cgi +) may not be the same version or using the same configuration.

Here's a note on cgi security: http://us.php.net/manual/pl/security.cgi-bin.php which has a comment which says: "NOTE: Running PHP as a CGI program will change the value of $_SERVER['SCRIPT_NAME']. When running via the (normal) mod_PHP mechanism, it will be set to the name of (actually, path to) the PHP script that's running. When running via CGI, it will instead point to the path of the CGI binary."

I suspected that there would be a clue in the runtime variables, so that's worth checking.

hth, adric

adric
  • 531
  • 2
  • 7
1

The phpinfo should really give you all the infomration you require regarding your current PHP implementation. It provides you with the PHP interpreter running, it's configuration directives, as well as letting you know whether you're running in mod_php or a cgi based ( in your case cgi based via CGI/FastCGI ).

What sort of additional information are you currently looking to get ?

jonathanserafini
  • 1,768
  • 14
  • 20