php - Symbolic link to database not working in /var/www -



I am working on a booklet site with access to real time weather data. Due to its security problems, I am using symbolic links from / var / www to my imagery data to avoid using the SUID. These are simple PNG files, and it's working.

Then I wanted real time data based on mouse position hovering over image data. For this, I created a SQLite3 database with the actual values. First of all, as a test, I manually put this database into the site root, and everything worked perfectly. Unfortunately I can not find that database in that place

In my site root

  
  
  < pre>  ln-sf / path / to / db / db chmod 777 /path/to/db/data.db   

then to query the file by a simple PHP program Read:

  & lt ;? Php $ lat = float ($ _GET ['lat']); $ Lane = float ($ _ GET ['lawn']); $ Db = new SQLite3 ('db / sst.db'); # Line6 $ result = $ db- & gt; Query ("Select from current order" ("$ latitude-lat") * ($ latitude-latitude) + ($ latitude-axis) + ($ lon-lon) * ($ lon-lon) * ASC LIMIT 1 ") ; While ($ line = $ result-> Fachtere ()) {echo $ line ['sst']; }? & Gt; Unfortunately, I'm getting this error in the browser console:  
  Failed to load resource: server 500 (internal server error)   

/ code>

Inspect the /var/log/apache2/error.log file I get the following error:

  PHP Fatal error: Ignored exceptions 'Exceptions' message Unable to open database 'with: Unable to open database file' /var/www/Mapea/sst.php:6\nStack trace: \ n # 0 /var/www/Mapea/sst.php(6): SQLite3 - & gt; __Construct ('db / sst.db') \ n # 1 {main} \ n    at the line 6 /var/www/Mapea/sst.php < What were the permissions on  / path ,  / path / to , but after the query of CL 

/ path / to / db , I found that the / path permissions were not correct.

After using the following command:

  chmod 755 / path   

My application is now working 100%.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -