probably stupid problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Snah

    probably stupid problem

    hi,

    i installed php on my XP Prof. PC (including IIS, Mysql)

    a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'] .
    '/phplib';

    is not working in php

    what's wrong ?


  • Pedro Graca

    #2
    Re: probably stupid problem

    Snah wrote:[color=blue]
    > i installed php on my XP Prof. PC (including IIS, Mysql)
    >
    > a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'] .
    > '/phplib';
    >
    > is not working in php
    >
    > what's wrong ?[/color]

    *HOW* is it not working?
    What does the basic command do? and what did you expect it to do?

    Is there an error message? A warning? A notice?
    [ enable notices by issuing ]

    <?php ini_set('error_ reporting', E_ALL); ?>

    [ at the top of your scripts or, perhaps ]
    [ better, by reconfiguring php.ini ]

    I remember a long time ago when I had PHP working under IIS. Some
    $_SERVER indexes available for Apache are not available for IIS (and
    vice-versa); I don't remember which.
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • Snah

      #3
      Re: probably stupid problem


      "Pedro Graca" <hexkid@hotpop. com> wrote in message
      news:c1j7ev$1js ppu$1@ID-203069.news.uni-berlin.de...[color=blue]
      > Snah wrote:[color=green]
      > > i installed php on my XP Prof. PC (including IIS, Mysql)
      > >
      > > a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'][/color][/color]
      ..[color=blue][color=green]
      > > '/phplib';
      > >
      > > is not working in php
      > >
      > > what's wrong ?[/color]
      >
      > *HOW* is it not working?
      > What does the basic command do? and what did you expect it to do?
      >
      > Is there an error message? A warning? A notice?
      > [ enable notices by issuing ]
      >
      > <?php ini_set('error_ reporting', E_ALL); ?>
      >
      > [ at the top of your scripts or, perhaps ]
      > [ better, by reconfiguring php.ini ]
      >
      > I remember a long time ago when I had PHP working under IIS. Some
      > $_SERVER indexes available for Apache are not available for IIS (and
      > vice-versa); I don't remember which.
      > --
      > --= my mail box only accepts =--
      > --= Content-Type: text/plain =--
      > --= Size below 10001 bytes =--[/color]

      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


      Comment

      • Pedro Graca

        #4
        Re: probably stupid problem

        Snah wrote:[color=blue]
        > 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[/color]

        You can print all the variables in $_SERVER with

        <?php
        echo '<pre>';
        print_r($_SERVE R);
        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_sa pi_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 =--

        Comment

        Working...