Build php-8.1.1 returns a fatal error

kasodk

Verified User
Joined
Oct 15, 2020
Messages
5
Location
Denmark
I get the following error when I try to build PHP 8.1.1?
It is a Debian 11 VPS.

/bin/sh /usr/local/directadmin/custombuild/php-8.1.1/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/fileinfo/ -I/usr/local/directadmin/custombuild/php-8.1.1/ext/fileinfo/ -I/usr/local/directadmin/custombuild/php-8.1.1/include -I/usr/local/directadmin/custombuild/php-8.1.1/main -I/usr/local/directadmin/custombuild/php-8.1.1 -I/usr/local/directadmin/custombuild/php-8.1.1/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/local/directadmin/custombuild/php-8.1.1/ext/mbstring/libmbfl -I/usr/local/directadmin/custombuild/php-8.1.1/ext/mbstring/libmbfl/mbfl -I/usr/local/directadmin/custombuild/php-8.1.1/TSRM -I/usr/local/directadmin/custombuild/php-8.1.1/Zend -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS -I/usr/local/directadmin/custombuild/php-8.1.1/ext/fileinfo/libmagic -c /usr/local/directadmin/custombuild/php-8.1.1/ext/fileinfo/libmagic/apprentice.c -o ext/fileinfo/libmagic/apprentice.lo -MMD -MF ext/fileinfo/libmagic/apprentice.dep -MT ext/fileinfo/libmagic/apprentice.lo


cc: fatal error: Killed signal terminated program cc1


compilation terminated.


make: *** [Makefile:1151: ext/fileinfo/libmagic/apprentice.lo] Error 1
 
There are no issues on VPS's with 2GB RAM or more.
Is this a resource problem because it is a VPS with 1GB RAM?
If so, is there a workaround?
 
You must have at least 780MB of memory and 920MB of hard disk space to perform a normal installation.
also Directadmin need some RAM and another processes. So yes, you need at least 2gb for fresh distro and all fresh programs, also you website will need some memory and mysql.. It's better to install older OS if you didn't have enough resources, like Centos 7. Or at least extend SWAP partition to 4gb.
 
From my experience Fileinfo PHP extension requires at least 1.5GB of memory for compilation. So if you have only 1GB memory, ensure you setup a swap file of at least 2GB to give you should room. Though swapping to disk is slower, it's still better than not being able to compile PHP.
 
Thanks for the replies.
I fixed the problem by extending the 1 GB SWAP with a 2 GB SWAP file.
During the build, it looked like a total of 2 GB SWAP would be enough.
 
Back
Top