PHP MapScript installation error

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I'm trying to install MapServer version 7.0.6. I also want php MapScript so I'm doing it by compiling from source. I've installed two versions of PHP (5.6 and 7) on my system (Linux Mint 18.1) but I've downgraded to 5.6 since as far as I'm concerned version 7 is still in development. So everything worked well until I got this error:

[ 82%] Building C object 
mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.o
In file included from 
/usr/local/src/mapserver/mapscript/php/php_mapscript.h:37:0,
              from 
/usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
/usr/local/src/mapserver/mapscript/php/php_mapscript_util.h:267:1: 
error: unknown type name ‘zend_object_value’
zend_object_value mapscript_object_new(zend_object *zobj,
 ^
In file included from 
/usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:0:
/usr/local/src/mapserver/mapscript/php/php_mapscript.h:461:8: error: 
unknown type name ‘zend_object_value’
extern zend_object_value mapscript_object_new(zend_object *zobj, 
zend_class_entry *ce,
    ^
/usr/local/src/mapserver/mapscript/php/php_mapscript.h:463:8: error: 
unknown type name ‘zend_object_value’
 extern zend_object_value mapscript_object_new_ex(zend_object *zobj, 
zend_class_entry *ce,
    ^
/usr/local/src/mapserver/mapscript/php/mapscript_error.c: In function 
‘mapscript_throw_exception’:
/usr/local/src/mapserver/mapscript/php/mapscript_error.c:53:10: 
warning: return from incompatible pointer type [-Wincompatible-
pointer-types]
return zend_throw_exception(mapscript_ce_mapscriptexception, message, 
0 TSRMLS_CC);
       ^
/usr/local/src/mapserver/mapscript/php/mapscript_error.c: In function 
‘zm_startup_mapscript_error’:
/usr/local/src/mapserver/mapscript/php/mapscript_error.c:114:37: 
error: too many arguments to function 
‘zend_register_internal_class_ex’
 mapscript_ce_mapscriptexception = 
 zend_register_internal_class_ex(&ce, 
 zend_exception_get_default(TSRMLS_C), "Exception" TSRMLS_CC);
                                 ^
 In file included from /usr/include/php/20160303/main/php.h:40:0,
             from 
 /usr/local/src/mapserver/mapscript/php/php_mapscript.h:35,
             from 
 /usr/local/src/mapserver/mapscript/php/mapscript_error.c:32:
 /usr/include/php/20160303/Zend/zend_API.h:292:28: note: declared here
  ZEND_API zend_class_entry 
  *zend_register_internal_class_ex(zend_class_entry *class_entry, 
  zend_class_entry *parent_ce);
                          ^
 mapscript/php/CMakeFiles/php_mapscript.dir/build.make:62: recipe for 
 target 
'mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.o' 
 failed
 make[2]: *** 
 [mapscript/php/CMakeFiles/php_mapscript.dir/mapscript_error.c.o] 
 Error 1
 CMakeFiles/Makefile2:547: recipe for target 
 'mapscript/php/CMakeFiles/php_mapscript.dir/all' failed
 make[1]: *** [mapscript/php/CMakeFiles/php_mapscript.dir/all] Error 2
 Makefile:127: recipe for target 'all' failed
 make: *** [all] Error 2

I've also installed php5.6-dev on my system.

Is there any fix for this?

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.