[MapServer-users] Compiling mapserver with php in user directory

Jan Hartmann j.l.h.hartmann at gmail.com
Thu Oct 19 08:55:33 PDT 2023


Hi Jeff, I appreciate your advice, but I solved the problem with a hack, 
and to be honest, CMAKE error handling is above me. I am still from the 
./configure generation :-)

I added these two lines to MapServer's CMAKE call:

  -DPHP_INCLUDE_PATH=$INSTALLBIN/include/php/main \
-DPHP_EXTENSION_DIR=$INSTALLBIN/lib/php/extensions/no-debug-non-zts-20220829

I also had to add these lines to GEOS's CMAKE, after 
-DCMAKE_INSTALL_PREFIX=$INSTALLBIN  -DCMAKE_PREFIX_PATH=$INSTALLBIN \

-DCMAKE_LIBRARY_PATH=$INSTALLBIN/lib \
-DINCLUDE_DIRECTORIES=$INSTALLBIN/include \

I guess CMAKE does not propagate its dependencies very well from the 
general INSTALL_PREFIX.

But this still didn't work. The php includes in other subdirectories 
than main weren't found. Those subdirectories should have been added to 
the include path, but weren't. So I copied the complete php include 
directory to /usr/include (O horror! :-)) .

Of course a Docker installation would be easier, as you can install 
everything in standard locations. But I want to have a real dedicated 
server with just the software I need and nothing more. I have worked for 
a long time with the UbuntuGIS packages, but they are not supported very 
well.

Thanks for your advice!

Jan



On 18/10/2023 19:11, Jeff McKenna via MapServer-users wrote:

Hi Jan,

I understand that you won't listen to my advice here, no problem at all. 
  But I won't repeat myself here 🙂

Enjoy your afternoon,

-jeff
> On 2023-10-18 1:39 p.m., Jan Hartmann wrote:
>> I compiled with:
>>
>>   -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \
>>   -DPHP_EXTENSION_DIR=$INSTALLBIN/lib/php/extensions/no-debug-non-zts-20220829 
>>
>>
>> and got lots of error messages about missing .h files (php.h, zend.h 
>> etc). I bulk copied them all to the directory in the build tree where 
>> the errors came from, and got a complete build, including 
>> "php_mapscriptng.so"
>>
>> So CMAKE is still missing the php include directories. What is de 
>> correct DEFINE for that?
>>
>> After I copied php_mapscriptng.so to the correct location and filling 
>> in php.ini, I got a warning when starting PHP :
>>
>> Startup: Unable to load dynamic library 'php_mapscriptng.so' (tried: 
>> /virdir/installbin/lib/php/extensions/no-debug-non-zts-20220829/php_mapscriptng.so 
>> (libgeos.so.3.12.0: cannot open shared object file: No such file or 
>> directory)
>>
>> But  it *is* in that location. Any idea?
>>
>> On 17/10/2023 21:45, Jeff McKenna via MapServer-users wrote:
>>> Hi Jan,
>>>
>>> Unfortunately I have much experience tracking down CMake errors now, 
>>> ha.
>>>
>>> Instead of the error log, scroll up and read the output from your 
>>> cmake command (as it does its checks and looks for libraries), I 
>>> find examining that output is crucial (and I personally find the 
>>> actual generated log file is filled of fake/"red-herrings"). Focus 
>>> instead on going line-by-line through that cmake output, as it makes 
>>> its way down to the final "configuring incomplete" message.  (for 
>>> packaging, this is what I do, line-by-line)
>>>
>>> For example, if you are trying to enable the GEOS library, I would 
>>> go line-by-line of the output and find where it was looking for GEOS 
>>> initially, and read the messages in that section, to confirm that 
>>> there are no issues when enabling GEOS.  This is crucial.
>>>
>>> It takes much time to do this for each library.
>>>
>>> In my case, for PHPNG support, my CMake command includes: 
>>> "-DWITH_PHPNG=1 -DPHP_EXTENSION_DIR=/usr/lib/php/20220829"
>>>
>>> In your case I am not sure, but, I would start by examining 
>>> line-by-line the CMake output before the words "Configuring 
>>> incomplete" (and totally ignoring the generated 'output' file).
>>>
>>> Maybe you can find the PHPNG section in your cmake command output, 
>>> and paste that here for the community to review.
>>>
>>> -jeff
>>>
>>>
>>>
>>>
>>
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20231019/bb018695/attachment.htm>


More information about the MapServer-users mailing list