Closed nospor closed 6 years ago
The variable PHP5_INCLUDE_PATH is defined in mapserver/mapserver/cmake/FindPHP5.cmake and can store booth, PHP5-path or PHP7-path, but of course never at the same time. To hold the backwards compability I made no changes in the name of this variable. The code in this reposority is compatible with PHP5 and PHP7. The CmakeList.txt is the original file from mapserver/mapserver (see https://github.com/mapserver/mapserver/blob/branch-7-0/mapscript/php/CMakeLists.txt). I compiled the code with this file on systems with PHP5 or PHP7, but never on a system with PHP5 and PHP7. If cmake do not find your right path, you should try to add it manually, e.g. cmake -D WITH_PHP=1 -D PHP_INCLUDES=/usr/include/php/20151012 .. or change the order for PHP5_POSSIBLE_INCLUDE_PATHS in FindPHP5.cmake to fit for PHP7, e.g. SET(PHP5_POSSIBLE_INCLUDE_PATHS ${PHP5_INCLUDES} /usr/include/php /usr/include/php5 /usr/local/include/php5 /usr/local/include/php /usr/local/apache/php )
Thank you for your response. I still have errors, maybe my version of cmake is not compatible with your. First, I can not run cmake -D WITH_PHP=1 -D PHP_INCLUDES=/usr/include/php/20151012 .. I need to run cmake -DWITH_PHP=1 -DPHP_INCLUDES=/usr/include/php/20151012 .. without space after D
Then it couldn't find file CMakeList.txt in build, so I moved one folder up which is php folder. Then I have errors like this:
By not providing "FindPHP5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "PHP5", but CMake did not find one.
because FindPHP5.cmake doesn't exist in this folder. It exists in cmake folder.
You can try this: Make a mapserver directory in your homedir:
cd ~
mkdir mapserver
Then extract the code from mapserver/mapserver to this directory and then replace the code in mapscript/php with the code from mapscript-php7. Now make a build directory and go to that build directory:
cd ~/mapserver
mkdir build
cd build
Run cmake und make from the build directory.
cmake -DWITH_PHP=1 ..
make
make install
Be sure that all needed libraries are installed before.
Errors are the same as before :(
Your CMakeList file is looking for php5. Why? You said this is for php7 so why it needs php5?