[nona.net home]
not logged inlog in
> home> software> ext_shapelib> installation
shapelib extension for PHP

ext_shapelib - download and installation

Download source code ::
C sources of ext_shapelib are available at the following link - the file is rather small, and retrying the download does not increase it's size ;)
Source code: ext_shapelib-0.0.1.tar.gz (15kB)
MD5 sum: 219297c1ecc4ce33a4b6bba9b8fcb5fb
Compile and install ext_shapelib ::
Installation is covered in the file "INSTALL" in the source archive. However, the instructions are available here as well. If you are building the extension on a Debian system, please refer to the file "INSTALL.Debian" in the archive. First, you will need to check your system for the following prerequisites.
prerequisites ::
Besides a working build environment (compiler, linker, etc.) you will need the PHP development environment plus (obviously) shapelib development files. Check if you can run "phpize", if you can, PHP development stuff is installed. Regarding shapelib, look for a file named "shapefil.h" in your include directory (usually "/usr/include").
If you are running Debian, you will need the packages "php4-dev", "shapelib" and "libshp1-dev" (the Shapelib packages are not available in mainstream Woody, but their respective Sarge sources compile fine on Woody)
unpack sources ::
nothing new - use "tar" and "gzip":
% gzip -dc ext_shapelib-0.0.1.tar.gz | tar -xv --
% cd ext_shapelib-0.0.1
compile ::
First, run the "phpize" tool, which prepares the "configure" script:
% phpize
phpize should yield no output - on some systems, it complains about missing autoconf stuff. You can safely ignore those warnings.
configure ::
phpize has created a "configure" script - the main purpose of the script is to check out where shapelib is installed. On most systems, you can run the command without any arguments
% ./configure
build ::
After configure has succeeded, it's time to start the build process with
% make
After a successful build, you should have a file called "ext_shapelib.so" in the "modules" directory.
Installing the extension ::
To install the extension (and make it available to PHP scripts) it needs to be copied into your extensions directory. In most cases, that can be done using
% su
# make install
If you have modified the extension path on your system (look for "extension_dir" in you php.ini) you will have to copy the file by yourself. After installation, you can check for success with a simple PHP script like:
<?
dl("ext_shapelib.so");
?>
You should be safe if the above snippet does not yield any warnings - ext_shapelib is now installed.