Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: A little php help?

  1. #1
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2

    A little php help?

    I'm working with gpsd and trying to output data from the gps to a web page. gpsd comes with a gps.php interface but when I try to run it, I get the following error:

    Code:
    Warning: fopen(gpsd_config.inc) [function.fopen]: failed to open stream: Permission denied in /var/www/gpsd.php on line 515
    can't generate prototype config file. try running this script as root in DOCUMENT_ROOT
    The gpsd_config.inc file does not exist but if I understand the code directly (locate here), it tries to create it if it does not exist. I must have something configured wrong on my Linux server but I'm a total noob at this and am not sure what I have to do. I already tried changing the document root to the /var/www folder but that doesn't seem to help.

    Other php scripts run okay in this same location. I installed phpmyadmin but can't even figure out how to get the path to pull up on my browser. I know I'm misconfigured but don't know what to look for. Any help is appreciated.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  2. #2
    Low Bitrate
    Join Date
    Jan 2008
    Posts
    87
    you need to allow the script and the location it is in to be wirteable (777)

  3. #3
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    Beautiful! I changed the permissions for the file but it didn't work. I changed them for the folder and it worked. Thanks!
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  4. #4
    Low Bitrate
    Join Date
    Jan 2008
    Posts
    87
    no problem mate

  5. #5
    FLAC
    Join Date
    May 2006
    Location
    Calgary, Alberta
    Posts
    1,718
    Ya, was going to suggest that. Usually web applications don't have permission to write to the root www folder so you either have it write somewhere else (recommended) or change the permissions on the root folder (not recommended).
    Ampie Case
    2.5" Hard Drive 80GB Samsung 5400RPM
    256 MB DDR2 PC5400
    Xenarc 700TSV - VGA Monitor
    Intel D945GCLF Motherboard
    M2-ATX-HV

    2005 Honda Civic

  6. #6
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    Or maybe, web apps should be using a database instead of the filesystem as a whole. {grumble grumble}

    Is that on your Sheeva? I'm stoked to see it working for you :-D

    And to clarify [although you probably know this by now], you only ever need on instance of gpsd running - that's part of the beauty of gpsd. Your PHP script, and obdgpslogger, and cgps, can all connect to the same instance of gpsd to grab data simultaneously.

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  7. #7
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    Yep, it's running on the Sheeva. I'm using a php script that grabs the deprecated control tags but I'd like to use JSON. I'm frantically searching the web for explanations of how to address gpsd to get that out of it.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  8. #8
    SuperMod - OBDII GPS Logger forum
    Auto Apps:loading...

    Join Date
    Mar 2009
    Location
    Los Angeles
    Posts
    924
    The JSON was still a work in progress.
    Look under "new protocol" at http://gpsd.berlios.de/gpsd.html

    Looks suspiciously like a manpage-to-html conversion, although the manpage on my box [and the manpage in 2.39] doesn't contain it - so I have a hunch that it's coming in 2.4 or something. [yep. That stuff appears in the svn versions of the manpages]

    So, yes. There's almost no info on it because nothing has been officially released. It's there if you look, but I wouldn't rely on it yet if I were you. Also, the version of gpsd I have on my ubuntu box is what-was-in-the-repo, version 2.38. Keep in mind that that's way outta date if you specifically want the JSON interface.

    What are you actually trying to achieve? Keep in mind that the gpsd.php script you're using now will probably be maintained alongside the core GPSd code, so it will always use whatever's most-up-to-date-and-appropriate. Ditto for the C API. If it'll work for you, the C API is almost trivially simple to use.

    Gary (-;
    OBDGPSLogger, for logging OBDII and/or GPS data
    OBDSim, an OBDII/ELM327 software simulator
    mp3car forums: obdgpslogger, obdsim

  9. #9
    Admin. Linux loser.
    Auto Apps:loading...
    Bugbyte's Avatar
    Join Date
    Sep 2004
    Location
    Corning, NY
    Posts
    7,359
    Blog Entries
    2
    I was just trying to serve up a web page on my iPhone using php that did just one thing - tell me what my speed is.

    The man page had all kinds of scary language like "deprecated, don't count on it". (It also mentioned a dbus implementation as well)

    In any case, I'll futz around with a little test script I have and get it to read the speed. Right now it doesn't do that.

    If you want to try it out, hit the Sheeva here: gpsd php script to read current GPS position.
    Quote Originally Posted by ghettocruzer View Post
    I was gung ho on building a PC [until] just recently. However, between my new phone having internet and GPS and all...and this kit...Im starting to have trouble justfiying it haha.
    Want to:
    -Find out about the new iBug iPad install?
    -Find out about carPC's in just 5 minutes? View the Car PC 101 video

  10. #10
    licensed to kill - FKA kev000
    Auto Apps:loading...
    tripzero's Avatar
    Join Date
    Aug 2006
    Location
    16.40618, 120.61106
    Posts
    2,494
    wow, that's awesome! Are you going to share the php scripts so someone like me can put them in some distro for carpc's ?

    I'm def going to have to get me a sheeva. Cool little device!
    Former author of LinuxICE, nghost, nobdy.
    Current author of Automotive Message Broker (AMB).
    Works on Tizen IVI. Does not represent anyone or anything but himself.

Page 1 of 2 12 LastLast

Similar Threads

  1. PHP...not reading url variables...
    By PoBoy in forum Off Topic
    Replies: 10
    Last Post: 09-16-2002, 09:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •