0

I'm on Windows 7, using PHP Version 5.6.14 on Apache 2.4 and I'm trying to access to a Spatialite database.

All works fine when execute "no spatial" SQL query in my PHP procedure but when I try to use the PtDistWithin in a query like ...

 SELECT .......... WHERE PtDistWithin(distr.geometry, MakePoint(13.571386, 37.314926, 4326), 1000);

the response is

SQLSTATE[HY000]: General error: 1 no such function: MakePoint

I'm sure that my query is right because if I execute it on Spatialite GUI it works.

In my php.ini I've enabled as follow

extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
[sqlite3]
sqlite3.extension_dir = D:\Programmi\Php\ext

and I've put in my PATH "D:\Programmi\Php\ext". In this directory there is

07/09/2015  16:32         8.118.531 mod_spatialite.dll

and all the others dll ... here you are the list

22/03/2015  16:43            62.671 libfreexl-1.dll
07/12/2014  23:35           113.152 libgcc_s_seh_64-1.dll
03/09/2015  18:09         1.335.271 libgeos-3-5-0.dll
03/09/2015  18:09           195.167 libgeos_c-1.dll
20/12/2014  10:01         1.546.608 libiconv-2.dll
20/04/2015  08:58           211.181 liblzma-5.dll
20/04/2015  09:36           461.564 libproj-9.dll
03/09/2015  18:13           956.115 libsqlite3-0.dll
07/12/2014  23:35         1.014.272 libstdc++_64-6.dll
15/02/2015  10:36         1.699.757 libxml2-2.dll

Any suggestion?

1 Answer 1

1

I suppose the mod_spatialite must be loaded by executing SQL SELECT load_extension('mod_spatialite.dll'). It requires also that sqlite3_enable_load_extension is called first.

Read https://stackoverflow.com/questions/8756146/how-to-load-sqlite-extension-in-pdo and http://www.sqlite.org/lang_corefunc.html#load_extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.