PHP: Enable static version of zlib

> cat /etc/SuSE-release 
SUSE LINUX 10.1 (i586)
VERSION = 10.1


I need to determine the dimensions of compressed swf-files. The function getimagesize() returns false and triggers a notice:

> php5 -r 'var_dump(getimagesize("f2fadb2a84e6cd697c62a25563641dac87dc07fe.swf"));'
PHP Notice:  getimagesize(): The image is a compressed SWF file, but you do not have a static version of the zlib extension enabled in Command line code on line 1

zlib, zlib-devel and php5-zlib are installed. On my OS X and Debian machines there are no errors, but I don’t know how to fix this on SuSe. PHP version is 5.2.6, configure command is the following:

'../configure' '--prefix=/usr' '--datadir=/usr/share/php5' '--mandir=/usr/share/man' '--bindir=/usr/bin' '--with-libdir=lib' '--includedir=/usr/include' '--sysconfdir=/etc/php5/apache2' '--with-config-file-path=/etc/php5/apache2' '--with-config-file-scan-dir=/etc/php5/conf.d' '--enable-libxml' '--enable-session' '--with-mm' '--with-pcre-regex' '--enable-xml' '--enable-simplexml' '--enable-spl' '--enable-filter' '--disable-debug' '--enable-inline-optimization' '--disable-rpath' '--disable-static' '--enable-shared' '--program-suffix=5' '--with-pic' '--with-gnu-ld' '--with-system-tzdata=/usr/share/zoneinfo' '--with-apxs2=/usr/sbin/apxs2' '--disable-all' '--disable-cli'

I did not compile PHP, I installed it with smart. Google did not help, I hope someone in this forum can.

Did you check this in your configure command line?

'--disable-static' '--enable-shared'

It seems that you are instructing php to build with shared libraries only.

I faced same problem today, can not get correct values for getimagesize(*.swf)…

Apache and PHP5 were installed through YAST

yast2 -i apache2 apache2-devel apache2-mod_perl apache2-mod_php5 apache2-prefork perl-HTML-Parser perl-HTML-Tagset perl-Tie-IxHash perl-URI perl-libwww-perl php5 php5-devel zlib zlib-devel

yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dbase php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-ncurses php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl

if i ran

./configure ... --with-zlib

for downloaded from source zlib works as it should

Is it possible to add " --with-zlib" to YAST PHP installation? Or is there any different way out?

P.S. Sorry for my english

No, you have to build your own PHP with zlib static. It’s a compilation issue, not an install issue.

But you could consider another way out of your problem:

SWF header parser (flash, html parser, swf, frame) - PHP Classes