NEWBIE php on os x local

Discussion in 'PHP' started by opencity, Oct 29, 2007.

  1. #1
    Hey forum thanks for any help.
    PHP 4.4.7
    Apache on OS X 10.3.9

    I've got php / drupal running locally. php works but I have to call it with absolute path. i.e. if I hard code a link I use http://127.0.0.1/directory/file.php it works, but if I call from the same directory as file.php I get the text of the script, not the returning hoped for output.
    I can't call jQuery with absolute path so I'm out of luck.

    I've been digging through http.conf file in Apache but don't see anything.

    Any ideas?
     
    opencity, Oct 29, 2007 IP
  2. schoash

    schoash Active Member

    Messages:
    291
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Try usin Firefox with the firebug plugin. It shows all the asynchronous requests and things which are going on in the background.

    Normally you don't have to change anything to make this work.
     
    schoash, Oct 29, 2007 IP
  3. opencity

    opencity Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hey thanks for getting back.

    I've got firebug. Doesn't seem to shoh anything wrong. Javascript sees a return from the php but what it sees is the entire php script, not the output xml. I'm still trying to figure out why I can't call the absolute path in javascript as well as the php returns text issue.

    Off road, spinning wheels. Ouch.
     
    opencity, Oct 29, 2007 IP
  4. schoash

    schoash Active Member

    Messages:
    291
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #4
    buhh sounds strange.
    did you setup any vhosts?
    And in the firebug console you also have the php output of the expected xml?
     
    schoash, Oct 29, 2007 IP
  5. opencity

    opencity Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for getting back.
    Firebug shows me text of script as response- same as an alert on load or hitting the page from a local link.
    no vhosts.

    I'm gonna figure out some non local host and see if it duplicates the problem.
     
    opencity, Oct 29, 2007 IP
  6. schoash

    schoash Active Member

    Messages:
    291
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #6
    btw a bad workaround.
    You can call the absolute address in jQuery with the help of a php proxy ;)

    edit: please post if you found a solution.. i am curious
     
    schoash, Oct 29, 2007 IP
  7. opencity

    opencity Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Don't know if it's a solution but ...

    If I call the html page from 127.0.0.1 instead of opening with the file menu then the php output loads as desired.

    I think this qualifies as a newbie mistake as I already knew I had to call the php with a full http call but it seems the html/javascript that calls the php must also be called with full http call.

    Further proof I'm a bonehead but moving forward now.
     
    opencity, Oct 29, 2007 IP