Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP compile: off_t undefined

Just a quick question: I want to compile PHP 7.1.6 and running into the following issue while executing the configure-script:

checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking size of off_t... 0
configure: error: off_t undefined; check your library configuration

These are my configure options:

./configure --prefix=/usr/local/php --disable-all --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-pdo --with-pdo-mysql=/usr/local/mysql --with-zlib=/usr/local --with-zlib-dir=/usr/local --with-ldap=/usr/local --with-curl=/usr/local --with-openssl=/usr/local/ssl --with-libxml-dir=/usr/local --with-iconv=/usr/local --with-iconv-dir=/usr/local --with-pcre-regex=/usr/local --with-pcre-dir=/usr/local --enable-filter --disable-debug --enable-inline-optimization --disable-rpath --disable-static --enable-session --enable-dom --enable-json --enable-ctype --enable-hash --enable-tokenizer --enable-xmlreader --enable-shared --enable-xml --enable-libxml --enable-simplexml --with-pic --enable-bcmath --with-gd --with-freetype-dir=/usr/local --with-png-dir=/usr/local --with-jpeg-dir=/usr/local --enable-gd-native-ttf --enable-mbstring --enable-zip --enable-intl --enable-soap --enable-exif

Maybe someone of you have some hints for me?

like image 468
Johannes P. W. Avatar asked Sep 19 '26 22:09

Johannes P. W.


2 Answers

The libzip version is not compatible with the php version. Using the latest version of libzip when compiling php7.3 will have this problem, and the downgrade will be fine.

wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

May have another problem: zipconf.h: No such file or directory https://github.com/Homebrew/legacy-homebrew/issues/13390

cp php-7.3.0/ext/zip/lib/zipconf.h /usr/local/include/ 
like image 90
Han L Avatar answered Sep 21 '26 14:09

Han L


On my configuration (PHP 7.3.7 and Centos 7.6.1810), the solution was a mix of Anastas Giokov's response and kkuhrman's response:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PHP_DIR/build-src/srclib/libzip-1.2.0/lib"

and

ln -s ../lib/zipconf.h $PHP_DIR//build-src/srclib/libzip-1.2.0/include/zipconf.h
like image 29
Stephane Dkz Avatar answered Sep 21 '26 14:09

Stephane Dkz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!