SUM: Building PHP Mapscript

Daniel Morissette dmorissette at MAPGEARS.COM
Tue Jul 17 14:06:37 EDT 2007


Bill Thoen wrote:
> Thanks everyone for helping get PHP MapScript to compile. I managed to 
> get it to work finally.  A word of warning though for anyone else who 
> might need to do this. Unless you plan to rebuild your copy of PHP, make 
> sure you use the same version of PHP source that you are running on your 
> machine. I first tried downloading the latest PHP source, but since that 
> was a few versions newer than what's running on my machine, the 
> resulting php_mapscript.so library wouldn't work (the API versions 
> didn't match). But when I used the same version of PHP source as I have 
> installed on my machine, everything worked fine. In retrospect, I should 
> have expected this, but I seem to have to bang my head against the wall 
> a few times before I realize why I have a headache...
> 

Well, by downloading and using the PHP source of the same version as 
what is installed on your machine the build worked fine, but there is a 
small possibility that you may still encounter intermittent crashes at 
runtime because the PHP headers are customized to match your build 
options by PHP's configure, and you didn't use the headers that match 
exactly your PHP build options. Options such as the version of REGEX or 
GD used by PHP have an impact on MapScript.

The only safe way to go is to either point to the PHP source tree that 
has been configured and compiled for your local install of PHP, or point 
to the installed header files (installed by make install or by a 
php-devel package).

Of course things may still work if you're lucky, but if you encounter 
intermittent crashes you'll know where to start looking.

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-users mailing list