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

2023-10-19 Thread Jan Hartmann via MapServer-users
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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2023-10-18 Thread Jeff McKenna via MapServer-users

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





--
Jeff McKenna
GatewayGeo: Developers of MS4W, & offering MapServer Consulting/Dev
co-founder of FOSS4G
http://gatewaygeo.com/



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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2023-10-18 Thread Jan Hartmann via MapServer-users

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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2023-10-17 Thread Jeff McKenna via MapServer-users
Maybe paste all of the output from the cmake command (upto the 
"configuring incomplete" message) at https://pastebin.com/ and paste 
that pastebin link here for the community to examine closely.


-jeff



On 2023-10-17 4:45 p.m., 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






--
Jeff McKenna
GatewayGeo: Developers of MS4W, & offering MapServer Consulting/Dev
co-founder of FOSS4G
http://gatewaygeo.com/

___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2023-10-17 Thread Jeff McKenna via MapServer-users

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




--
Jeff McKenna
GatewayGeo: Developers of MS4W, & offering MapServer Consulting/Dev
co-founder of FOSS4G
http://gatewaygeo.com/




On 2023-10-17 4:24 p.m., Jan Hartmann via MapServer-users wrote:

Hi all,

  I am trying to compile MapServer with all dependencies in a separate 
user-directory. Everything has been compiled with —prefix=$INSTALLBIN.  PHP has 
also been compiled into that directory, but I don't get MapServer to use it. It 
compiles against the system-php, but that is another version than the compiled 
one. I call CMAKE with the following options:

...
 -DGDAL_LIBRARY=$INSTALLBIN/lib/libgdal.so \
 -DGDAL_INCLUDE_DIR=$INSTALLBIN/include \
 ...

I removed the sysem-PHP, and added -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \, 
but that doesn't work, and I cannot find the PHP-library to add.

CMAKE ends with the message:  "Configuring incomplete, errors occurred!", without giving the precise 
errors. In the error log I get messages of missing "strrstr", "strlcat" and strlcpy".

Can you help me?

Jan Hartmann
Amsterdam
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users



___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


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

2023-10-17 Thread Jan Hartmann via MapServer-users
Hi all,

 I am trying to compile MapServer with all dependencies in a separate 
user-directory. Everything has been compiled with —prefix=$INSTALLBIN.  PHP has 
also been compiled into that directory, but I don't get MapServer to use it. It 
compiles against the system-php, but that is another version than the compiled 
one. I call CMAKE with the following options:

   ...
-DGDAL_LIBRARY=$INSTALLBIN/lib/libgdal.so \
-DGDAL_INCLUDE_DIR=$INSTALLBIN/include \
...

I removed the sysem-PHP, and added -DPHP_INCLUDE_DIR=$INSTALLBIN/include/php \, 
but that doesn't work, and I cannot find the PHP-library to add.

CMAKE ends with the message:  "Configuring incomplete, errors occurred!", 
without giving the precise errors. In the error log I get messages of missing 
"strrstr", "strlcat" and strlcpy".

Can you help me?

Jan Hartmann
Amsterdam
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users