Announcement

Collapse
No announcement yet.

A little php help?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.
    Originally posted by ghettocruzer
    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
    you need to allow the script and the location it is in to be wirteable (777)

    Comment


    • #3
      Beautiful! I changed the permissions for the file but it didn't work. I changed them for the folder and it worked. Thanks!
      Originally posted by ghettocruzer
      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

      Comment


      • #4
        no problem mate

        Comment


        • #5
          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

          Comment


          • #6
            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

            Comment


            • #7
              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.
              Originally posted by ghettocruzer
              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

              Comment


              • #8
                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

                Comment


                • #9
                  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.
                  Originally posted by ghettocruzer
                  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

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      Originally posted by kev000 View Post
                      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!
                      No question about it. When I start to figure out what the hell I'm doing, I want to resurrect the Linux web based front end thread. Maybe use scripts to control nghost functions from a server out on the internet. Backup functionality would be on the Sheeva in case no data connection is available.

                      I guess they already make these, but a Sheeva WiFi router would be good. I guess that's what the DD-WRTs are. Doesn't matter, though. I've got an old WiFi router that can be pressed into service.
                      Originally posted by ghettocruzer
                      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

                      Comment


                      • #12
                        Now that school is back in session, I haven't had much time to work on a Web Front End.

                        I'm working on college applications, I'm a class officer at my school, I'm the co-chair of my school's School Council, I'm part of the school's technology committee, I'm running Cross Country, and with school in session, there are always more parties. ;-)

                        It's safe to say I've been pretty busy. Once my college applications are done though, I should have significant amounts of extra time.

                        I do have my sheeva plug set up as a router, by the way. I have it hooked up to a Verizon USB 3G modem, and a random $20 wireless router from woot.com. I turned off DHCP and NAT in the wireless router, plugged the Sheeva into it and set the Sheeva up as an iptables gateway and a DHCP server. Never fails. One thing is though, I had to set it up to send out a ping every few minutes because verizon disconnects an idle connection every 5 minutes.
                        My Nearly Complete Car:
                        http://www.mp3car.com/vbulletin/show...ed-car-pc.html

                        Micro Control Center... Control Your Car Across the Internet
                        http://www.mp3car.com/fusion-brain/1...-internet.html

                        Website: (It's a work in progress, really. All my projects have taken me from ever really developing it.)
                        http://paulfurtado.com/

                        Comment


                        • #13
                          Very cool! That's pretty much what I'm looking to have in the car.

                          I've made a bit of progress on the php speedometer. I'm not use to coding html by hand but if you know what you want, it can be figured out okay. I'm on travel all this week so I may not make any additional progress for a bit.

                          The next items on my list are to get the Fusion Brain to work and also to control my XM direct radio from the Sheeva via the FTDI interface. I'll build web pages to control both of those from the iPhone as well.
                          Originally posted by ghettocruzer
                          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

                          Comment

                          Working...
                          X