[mapserver-users] recomm. for OS X (was Re: Cannot dynamically load php_mapscript.so)

Puneet Kishor pkishor at GeoAnalytics.com
Mon Apr 22 08:48:28 EDT 2002


Thanks Steve. Your answer set me on the correct path, however, I am 
still not close to nirvana.

I looked at your notes on the wiki. While it says that PHP as a CGI is 
required for Mapscript, you also note that I could run with PHP as a 
DSO... just that I would experience random weird behaviour. I am 
assuming though that PHP as a CGI _is required_ for Mapscript.

Anyway, I rebuilt PHP as a CGI but I still get a perplexing behaviour 
from Apache. It simply refuses to run the php scripts. I get the famous

(8)Exec format error: exec of /Library/WebServer/Documents/phpinfo.php 
failed
[client 192.168.123.253] Premature end of script headers: 
/Library/WebServer/Documents/phpinfo.php


Yes, I have the requisite AddType and AddHandler statements present, and 
yes, my scripts are chmod-ed to be executable. Apache just doesn't seem 
to know where my php bin is. I even put a ScriptAlias to the php bin, 
and turned on Options +ExecCGI... no luck.

Of course, if I put a shebang line (#!/usr/local/bin/php -q) at the top 
of the script it works. The "-q" is important so the script doesn't spit 
out the shebang line itself.

I have spent two entire sleepless nights on this now (well, including 
all the thousand prerequisites that I had to recompile... what a house 
of cards). I am sure I will find an answer to this sooner or later.

But at this time I can't possibly recommend PHP/Mapscript for MacOS X 
users. They would be much, much better off sticking with Perl/Mapscript 
which compiles like s*** through goose, and works splendidly with 
mod_perl. The problem is the OS X comes with Apache and PHP (as DSO) 
precompiled and installed. Since, PHP/Mapscript can only work as a CGI, 
one has to recompile Apache as well and then compile PHP. Recompiling 
Apache means that one has to recompile Perl as well (and mod_perl, if 
desired) in order to make everything else work smoothly. Uggghhhhhh!

Still crazy after all these years,

pk/



On Sunday, April 21, 2002, at 07:35  AM, Stephen Woodbridge wrote:

> Puneet Kishor wrote:
>>
>> Warning:  Cannot dynamically load php_mapscript.so - dynamic modules 
>> are
>> not supported
>>
>> I get the above error trying to load the so. My phpinfo() shows me that
>> enable_dl is "on", yet it also says the "Dynamic Library Support is not
>> available"
>>
>> What is it that I am missing? PHP 4.0.6 is compiled --with-apxs against
>> Apache 1.3.24.
>
> Well this does not answer your question, but points at another problem.
> Your PHP is an apache DSO (because you compiled it --with-apxs) this is
> not PHP was a CGI which is required for PHP/Mapscript. You will get all
> kinds of runaway process issues, random PHP crashes and other issues if
> you use your system in this configuration.
>
> If you want PHP as a DSO for other applications that is fine, but you
> need to build a CGI version for use with Mapscript and change you php
> file extensions to be different and configure apache to use the CGI for
> PHP/mapscript file extension.
>
> There has been a lot writen about this in the archives and DM Solutions
> has a detailed instructions on their site. Also look at wiki which is
> probably the best starting point.
>
> -Steve W.




More information about the mapserver-users mailing list