Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 696ab6d939cc7bb56b651a0a3a4eaf41 > files > 5

php-shp-0.9.2-14.x86_64.rpm

Wrapper library to libshape : http://shapelib.maptools.org/ 

"The Shapefile C Library provides the ability to write simple C programs for
reading, writing and updating (to a limited extent) ESRI Shapefiles"

The library can be downloaded from here :
http://dl.maptools.org/dl/shapelib/

shapelib-1.2.10.tar.gz will do a good job.

Unpack it for example in /usr/local/src . cd to there and do 
> make lib && make lib_install
Then install the extension by either using the PECL installer:
with `pecl install` or the manual way (for shared module)
cd shp/
phpize
./configure
make && make install

If you want to build it as a part of the PHP binary then do the following:
1. Pickup a source tarball from php.net
2. Unpack it somewhere
3. Enter in somewhere/ext
4. Unpack the extension
5. Go one directory up
6. mv configure configure_dist
7. ./buildconf
8. ./configure --with-shp --with-your-usual-options 
9. make

Step 7 is important, because it will rebuild the configure script and
include support for the extension.

To run the tests in the tests/ directory you need to get only the sample
files from the download page : shape_eg_data.zip . Then unzip in a
directory and copy the following files
- mexico/lakes.shp
- mexico/lakes.shx

in /tmp and the run the PHP test suite like this

export TEST_PHP_EXECUTABLE=php
php run-tests.php 


Enjoy!