ID: 16841 Comment by: gmunoz at atichile dot com Reported By: daniel at pressure dot net dot nz Status: Closed Bug Type: GD related Operating System: Linux PHP Version: 4.2.0 New Comment:
Hi .. I installed APACHE 1.3.27, GD 2.0.11 and PHP 4.3.1 on solaris 2.6 , but I got a fatal error on function imagepng(). Fatal error: Call to undefined function: imagepng() in /www/htdocs/png.php on line 8 How do i get imagepng() to work properly? You can see the details below: Install Apache 1.3.27 ************************* ./configure --prefix=/www --enable-module=so --with-port=82 make make install install GD 2.0.11 ******************* ./configure make make install Install PHP 4.3.1 ******************** ./configure --disable-all --with-gd=shared --with-apxs=/www/bin/apxs --enable-ftp --with-gd-dir=/usr/local/lib --with-jpeg-dir=/usr/lib --with-png-dir=/usr/local/lib --with-xpm-dir=/usr/X11R6 --with-ttf --with-zlib --with-oci8=$ORACLE_HOME --with-oracle=$ORACLE_HOME make make install file png.php *********************** <?php header ("Content-type: image/png"); $im = @imagecreate (50, 100) or die ("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng ($im); ?> ****************** Fatal error: Call to undefined function: imagepng() in /www/htdocs/png.php on line 8 Previous Comments: ------------------------------------------------------------------------ [2002-06-02 19:05:37] [EMAIL PROTECTED] So this clearly isn't any bug in PHP. Users should always make sure they're linking with same libraries in this kind of cases. ------------------------------------------------------------------------ [2002-06-02 13:29:36] johan at ekenberg dot se I experienced a similar thing with PHP-4.2.1 + pdflib-4.0.2 on Linux (glibc-2.2.3). However, recompiling pdflib with: "--with-pnglib --with-zlib" (and then rebuilding PHP) solved the problem. My backtrace from before recompiling pdflib was a bit different, I'm including it here in case it might be of interest: Program received signal SIGSEGV, Segmentation fault. 0x251 in ?? () (gdb) bt #0 0x251 in ?? () #1 0x80f0010 in _php_image_output_ctx (ht=1, return_value=0x82fc314, this_ptr=0x0, return_value_used=0, image_type=2, tn=0x818c38b "PNG", func_p=0x816c010 <gdImagePngCtx>) at gd_ctx.c:94 #2 0x80f21d2 in zif_imagepng (ht=1, return_value=0x82fc314, this_ptr=0x0, return_value_used=0) at gd.c:1479 #3 0x8155bba in execute (op_array=0x82fc524) at ./zend_execute.c:1598 #4 0x80d0659 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #5 0x806c081 in php_execute_script (primary_file=0xbffff9b4) at main.c:1381 #6 0x80664b1 in main (argc=2, argv=0xbffffa44) at cgi_main.c:778 #7 0x3232eb in __libc_start_main () from /lib/libc.so.6 (gdb) frame 3 #3 0x8155bba in execute (op_array=0x82fc524) at ./zend_execute.c:1598 1598 ((zend_internal_function *) EX(function_state).function)->handle r(EX(opline)->extended_value, EX(Ts)[EX(opline)->result.u.var].var.ptr, EX(object).ptr, return_value_used TSRMLS_CC); (gdb) print (char *)(executor_globals.function_state_ptr->function)->common.function_name $1 = 0x818bd55 "imagepng" ------------------------------------------------------------------------ [2002-05-29 00:00:06] php-bugs at lists dot php dot net No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2002-05-24 03:36:52] jb dot quenot at caraldi dot com I'm experiencing the same problem on FreeBSD 4.5 with PHP 4.2.1, libpdf's internal support for PNG conflicts with PHP linking against libpng. The two libpng versions differ from libpdf to PHP. Maybe the people from libpdf could add some configure options to allow the external libpng to be grabbed, but for now the --with-libpng does not accept a path as argument, so compilation fails. In our hosting company, the support for libpdf is suspended until the bug is fixed. ------------------------------------------------------------------------ [2002-05-13 06:35:41] k dot allan-php at au dot darkbluesea dot com I am having a similar problem, if you notice in the backtrace, it references /usr/lib/libpng.so.3 on my system this is soft-linked to libpng.so.5, and if I remove --with-pdflib from my configure line, it seems to link against the correct library and not segfault, but --with-pdflib it reverts to the version 3 library and segfaults when I try to create from PNG in the GD routines ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/16841 -- Edit this bug report at http://bugs.php.net/?id=16841&edit=1