Hi Cesare and Mark,
On Sun, 6 Dec 2015 18:20:37 -0800 (PST), mj10777 wrote:
> On Sunday, 6 December 2015 17:18:42 UTC+1, cesare gerbino wrote:
>> NOTE: I've to use the complete path at my _mod_spatialite ....._
>>
Cesare, this is simply because Debian (and Ubuntu too) will never
automatically search binary executables on /usr/local/lib
note: Fedora, CentOS and RHEL adopt an exactly opposite convention,
and /usr/local/lib is always included in the system search path.
on Debian (and on derived distro, such as Ubuntu or Mint) you are
required to explicitly set the LD_LIBRARY_PATH env variable:
export "LD_LIBRARY_PATH=/usr/local/lib"
after declaring the above env variable PHP CLI will be immediately
able to successfully execute "SELECT load_extension('mod_spatialite')"
(just declaring a relative path without any suffix)
> The goal of the script was to emulate a wms server
> - to return either
> -- spatialite geometries OR
> -- rasterlite2 images
>
> php.ini
> - inform loadExtension where to look
>
> [sqlite3]
> sqlite3.extension_dir = /usr/local/lib
>
Mark, setting "sqlite3.extension_dir=/usr/local/lib"
will certainly work, but could eventually open some
dangerous security breach, because this way PHP/sqlite3
will then be able to load any possible extension may
be including some dangerous one.
setting "sqlite3.extension_dir = /var/www/sqlite3_ext"
is a safer solution, because you'll then be required
to manually copy all authorized extensions one by one,
and this will probably help to fully preserve a stronger
web security.
> - loadExtension : does not use a path
> -- being defined in php.ini
> -- adding '.so' was needed to work correctly
>
yes, I confirm.
for some obscure reason explicitly adding a ".so"
suffix seems to be strictly required when loading
the mod_spatialite extension from the PHP own path.
bye Sandro