php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69810 Imagick compile error with PHP7
Submitted: 2015-06-12 11:40 UTC Modified: 2015-09-19 14:49 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: r1d3r at abv dot bg Assigned: danack (profile)
Status: Not a bug Package: imagick (PECL)
PHP Version: 7.0.0alpha1 OS: ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: r1d3r at abv dot bg
New email:
PHP Version: OS:

 

 [2015-06-12 11:40 UTC] r1d3r at abv dot bg
Description:
------------
Hello, i am having problem to compile RC2.

I build my php :

./configure  --prefix=whatever  --with-config-file-path=whatever --enable-mbstring  --enable-zip --enable-exif --enable-calendar --with-curl --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr  --with-freetype-dir=/usr  --with-openssl  --with-mysqli=mysqlnd --enable-sockets  --with-libdir=/lib/x86_64-linux-gnu

after that i go to iamgick folder and call:

./configure --with-php-config=/opt/php7alpha1/bin/php-config

so far so good.

after that typing make gives me this after 2nd line of compiling:


 cc -fopenmp -I/usr/include/ImageMagick -I. -I/home/user/imagick-3.3.0RC2 -DPHP_ATOM_INC -I/home/user/imagick-3.3.0RC2/include -I/home/user/imagick-3.3.0RC2/main -I/home/user/imagick-3.3.0RC2 -I/opt/php7alpha1/include/php -I/opt/php7alpha1/include/php/main -I/opt/php7alpha1/include/php/TSRM -I/opt/php7alpha1/include/php/Zend -I/opt/php7alpha1/include/php/ext -I/opt/php7alpha1/include/php/ext/date/lib -I/usr/include/ImageMagick -DHAVE_CONFIG_H -g -O2 -c /home/user/imagick-3.3.0RC2/imagick_file.c  -fPIC -DPIC -o .libs/imagick_file.o
In file included from /opt/php7alpha1/include/php/main/php.h:398:0,
                 from /home/user/imagick-3.3.0RC2/php_imagick.h:40,
                 from /home/user/imagick-3.3.0RC2/imagick_file.c:21:
/home/user/imagick-3.3.0RC2/imagick_file.c: In function ‘php_imagick_read_image_using_php_streams’:
/home/user/imagick-3.3.0RC2/imagick_file.c:193:58: error: ‘ENFORCE_SAFE_MODE’ undeclared (first use in this function)
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/opt/php7alpha1/include/php/main/php_streams.h:564:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
/home/user/imagick-3.3.0RC2/imagick_file.c:193:58: note: each undeclared identifier is reported only once for each function it appears in
  stream = php_stream_open_wrapper(file->filename, "rb", (ENFORCE_SAFE_MODE|IGNORE_PATH) & ~REPORT_ERRORS, NULL);
                                                          ^
/opt/php7alpha1/include/php/main/php_streams.h:564:107: note: in definition of macro ‘php_stream_open_wrapper’
 #define php_stream_open_wrapper(path, mode, options, opened) _php_stream_open_wrapper_ex((path), (mode), (options), (opened), NULL STREAMS_CC)
                                                                                                           ^
make: *** [imagick_file.lo] Error 1





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-12 12:20 UTC] r1d3r at abv dot bg
-Summary: make gives error +Summary: imagick make gives error
 [2015-06-12 12:20 UTC] r1d3r at abv dot bg
better title
 [2015-06-12 12:33 UTC] kalle@php.net
-Summary: imagick make gives error +Summary: make gives error -Status: Open +Status: Analyzed
 [2015-06-12 12:33 UTC] kalle@php.net
Thats right, 7.0.0 removed the ENFORCE_SAFE_MODE left over macro, which was used for cross version compatability in the 5.x series, but since it was removed in 5.4 it made no sense to keep in 7.0 with the extensive changes made to the internal extension API anyway
 [2015-06-13 06:19 UTC] kalle@php.net
-Summary: make gives error +Summary: Imagick compile error with PHP7
 [2015-06-13 06:19 UTC] kalle@php.net
Fixed title (again)
 [2015-06-13 22:20 UTC] danack@php.net
You might want to try the branch that supports PHP 7 https://github.com/mkoppanen/imagick/tree/phpseven

Kalle, is there a timeframe for when the ABI for 7 will be locked down, and so it will be 'safe' for extensions to mark themselves as supporting PHP 7 in the package.xml?
 [2015-06-13 22:20 UTC] danack@php.net
-Assigned To: +Assigned To: danack
 [2015-06-16 21:22 UTC] kalle@php.net
Dan, the plan is to lock down the ABI in the betas unless something critically can only be fixed by doing so.

The extension and Engine APIs are mostly (tm) considered complete, but for this paticular define, its safe to assume it won't return.

I suggest a simple fix like this:
#ifndef ENFORCE_SAFE_MODE
# define ENFORCE_SAFE_MODE 0
#endif

To avoid a lot of #if PHP_VERSION_ID > XXX
 [2015-06-24 07:01 UTC] r1d3r at abv dot bg
Btw php 5.6.10 has the same problem. 
Imagick is unusable at the moment i think ( or at least for me )
 [2015-06-25 08:03 UTC] kalle@php.net
PHP 5.6 should not have this problem at all, as ENFORCE_SAFE_MODE is still declared:
http://lxr.php.net/xref/PHP_5_6/main/php_streams.h#497
 [2015-06-26 07:30 UTC] r1d3r at abv dot bg
Hmm, yeah. Probably i forgot to run "make clean".

Sorry
 [2015-09-19 14:49 UTC] danack@php.net
-Status: Analyzed +Status: Not a bug
 [2015-09-19 14:49 UTC] danack@php.net
The 7 branch will be moved to master in a day or two.
 [2015-12-04 08:32 UTC] eugene at zhegan dot in
Fix mentioned above allows to go past first build error, but then the next one comes:

/tmp/pear/temp/imagick-3.1.2/imagick_class.c:797:45: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2

Furthermore, a hge number of warnings arise(not all of them are shown here):


/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_pingimageblob’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:84:11: warning: cast to pointer from integer of different size             
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_vignetteimage’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:111:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_transposeimage’:                                 
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:137:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_transverseimage’:                                
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:163:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_adaptiveblurimage’:                              
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:192:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_uniqueimagecolors’:                              
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:218:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_contraststretchimage’:                           
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:246:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_getimagematte’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:273:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:276:2: warning: ‘MagickGetImageMatte’ is deprecated (declared at /usr/local
/ImageMagick/include/ImageMagick-6/wand/deprecate.h:82)                                                                 
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_setimagematte’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:300:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_adaptiveresizeimage’:                            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:328:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_sketchimage’:                                    
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:358:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_shadeimage’:                                     
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:386:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_getsizeoffset’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:413:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_setsizeoffset’:                                  
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:438:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_adaptivesharpenimage’:                           
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:463:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_randomthresholdimage’:                           
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:491:11: warning: cast to pointer from integer of different size            
/tmp/pear/temp/imagick-3.1.2/imagick_class.c: In function ‘zim_imagick_roundcornersimage’:                              
/tmp/pear/temp/imagick-3.1.2/imagick_class.c:526:11: warning: cast to pointer from integer of different size
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC