Re: probably stupid problem

From: Pedro Graca (hexkid_at_hotpop.com)
Date: 02/26/04


Date: 26 Feb 2004 00:56:38 GMT

Snah wrote:
> Your right that's the problem, in the meantime i discovered the phpinfo()
> function call. This allows me easily to compare the different platforms.
> Thanks for your tip

You can print all the variables in $_SERVER with

<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>

for both servers, and print/compare the output.
It's easier than the output of phpinfo() :)

I also remember I ended up doing something like:

<?php // config.inc.php
if (stristr(php_sapi_name(), 'apache') {
  $DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
  $OTHER_VARS = $_SERVER['OTHER_VARS'];
} else { // IIS
  $DOCUMENT_ROOT = $_SERVER['ROOT_DIRECTORY']; // probably wrong
  $OTHER_VARS = $_SERVER['EXTRA_VARS'];
}
?>

and then require that file (which had more things in it) and using

$DOCUMENT_ROOT (instead of $_SERVER['DOCUMENT_ROOT'])

for scripts running on apache or IIS.

-- 
            --= my mail box only accepts =--
            --= Content-Type: text/plain =--
            --=  Size below 10001 bytes  =--


Relevant Pages

  • Re: php.ini errors?
    ... The Apache logs show nothing special, ... Move it back, fix anything you have done that caused phpinfo() to not display anything, and check in your phpinfo output which php.ini file you're using. ... Configuration File Path C:\Windows ...
    (comp.lang.php)
  • Re: [PHP] Ways to tell if existing setup is SAPI or Shared Object?
    ... installation or if it's installed as a shared object? ... I've dropped a file containing phpinfo() on the server I'm looking at, ... "Apache 2.0 Filter," and I don't know if Apache filters are required ... If I had to take a wild guess, I'd say "Filter" was a shared object... ...
    (php.general)
  • Re: php.ini errors?
    ... The Apache logs show nothing special, ... Move it back, fix anything you have done that caused phpinfo() to not display anything, and check in your phpinfo output which php.ini file you're using. ... "Loaded Configuration File " I think is the operative part. ...
    (comp.lang.php)
  • Re: PHP and PEAR and MySQL Setup on Apache
    ... htdocs directory and have them run. ... MDB2.php libraries to run - right now I am getting an MDB2.php not ... the htdocs directory of Apache. ... Where does phpinfo() pull the include_path ...
    (comp.lang.php)
  • Re: problem loading phpinfo
    ... My Apache is httpd-2.2.3. ... : in apache configuation file: ... AddType application/x-httpd-php .php ... <?php phpinfo(); ?> ...
    (php.general)