简介

编译此扩展无需任何额外的库,但想要 PHP 支持 Linux 的 LFS(large files),需要最新的 glibc,并在编译 PHP 时带上以下标记: -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

add a note add a note

User Contributed Notes 1 note

up
0
hb at testwelt dot deneb dot uberspace dot com
8 years ago
That does not work:

System: ubuntu 16.04 32-Bit

1. downloaded the sources php-5.6.26 from php.net
2. unpacked the tar.bz2
3. configured:
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" ./configure --prefix=$HOME/opt/php-largefile-test/ \
--disable-all --enable-cli > ../log.delme
4. make && make install
5. create some testfiles:
truncate -s1G 1G_file
truncate -s2G 2G_file
truncate -s4G 4G_file
truncate -s8G 8G_file
truncate -s16G 16G_file

6. check filesize of the testfiles with filesize()-function:
16G_file  size: 0
1G_file size: 1073741824
2G_file size: -2147483648
4G_file size: 0
8G_file size: 0

Whats wrong here?
To Top