why php script works through firefox and doesn't work under cmd

Discussion in 'PHP' started by MarsHu, Jun 30, 2010.

  1. #1
    Hi,
    I wrote a script to connect to a remote oracle and it works well when i open it through firefox, but when i execute it under cmd, the " oci_connect(): OCIEnvNlsCreate() failed " appears. I am not the administrator of my notebook, is there anything to do with this? Or what shoud i do to make the script work both under apache(firefox) and cmd?

    Thanks
     
    MarsHu, Jun 30, 2010 IP
  2. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #2
    The php-cli has a seperate php.ini - have you enabled the extension in both ini files?
     
    lukeg32, Jul 1, 2010 IP
  3. MarsHu

    MarsHu Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    well, i searched my machine and there is only one php.ini...it's in my php root directory. And where is the another one supposed to be ?
     
    MarsHu, Jul 1, 2010 IP
  4. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Ah right - You are on windows? Then that isnt the problem, *nix systems have 2 ini's

    Im not sure why you would be having a problem on CLI only then, windows isnt really my thing im afraid :/
     
    lukeg32, Jul 1, 2010 IP
  5. MarsHu

    MarsHu Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yean, always the windows... I may recheck the documentation and hope i could notice something i didn't notice. Thank you anyway.
     
    MarsHu, Jul 1, 2010 IP
  6. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #6
    Are you basing anything (such as the configuration) on the hostname in the browser, and hence wouldn't work via command line? I've worked on code before that sets up the entire environment based on the hostname, so just a thought.
     
    mfscripts, Jul 1, 2010 IP
  7. MarsHu

    MarsHu Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well, I'm a beginner and i'm not sure i got your point. Could you please make an example( about the configuration or something else ) if it's ok. And Thanks for your advice.
     
    MarsHu, Jul 1, 2010 IP