Sunday 26 July 2015

php - How to configure wampserver for spatialite


I am in windows 7. I installed WAMPServer. Now, I can not load spatialite libraries. It is showing warning..



Warning: SQLite3::loadExtension() [sqlite3.loadextension]: Not supported in multithreaded Web servers




Here is my total configuration procedure, what I have done...


From this link I got spatialite lib. I copied "libspatialite-1.dll" and paste it to "D:\wamp\bin\php\php5.3.8\ext" which contains php extention dlls.


http://www.gaia-gis.it/spatialite-2.3.1/libspatialite-win-x86-2.3.1.zip


Then I edited php.ini file. I changed the following configuration.


.
sqlite3.extension_dir = C:\libspatialite-win-x86-2.3.1\bin
.
extension=libspatialite-1.dll
.

enable_dl = On

And lastly, I copy and paste all the libraries from my downloaded libspatialite-win-x86-2.3.1 to my project folder(libspatialite.a, libspatialite.dll.a, libspatialite.la) in my php code i write the script as follows...



$db = new SQLite3('sixcommunes.sqlite');

$db->loadExtension('libspatialite.a');

$rs = $db->query('SELECT spatialite_version()');

while($row = $rs->fetchArray()){
print "

SQLite version: $row[0]

";
}

?>

I do not know what I have done wrong or how to solve this problem?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...