PHP Conference China 2020

Introduction

No external libraries are needed to build this extension, but if you want PHP to support LFS (large files) on Linux, then you need to have a recent glibc and you need compile PHP with the following compiler flags: -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
3 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