Control Web Panel

WebPanel => PHP => Topic started by: tim on February 05, 2021, 01:09:50 AM

Title: Php switch doesn't work on a 1GB memory VPS.
Post by: tim on February 05, 2021, 01:09:50 AM
I can not switch from 5.6.37 to ANY other version higher than 5.
Tried different options such as:
Log ends with:
Code: [Select]
virtual memory exhausted: Cannot allocate memory
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
Make Install DONE!
####################
PHP Rebuild Completed
#########################
I am on VPS with 1GB memory and my provider doesn't allow me to manage memory/swaps.
So it looks like there's a low memory problem. Is there any chance to upgrade PHP?
php-rebuild.log:https://pastebin.com/zJHVXy4k (https://pastebin.com/zJHVXy4k)

Title: Re: Php switch doesn't work on a 1GB memory VPS.
Post by: cinique on February 05, 2021, 01:52:43 AM
Quote
I am on VPS with 1GB memory and my provider doesn't allow me to manage memory/swaps.
This doesn't make sense; if you have root access, then you can resize/rallocate discs and/or create a swap file. The only exception that I can think of offhand, is OpenVZ;even then a swapfile should be possible,assuming you can write to /etc/fstab.
Otherwise, find another provider.
Forget about clamd/clamav/amavis/spamassasin and you should be fine. (I run PHP5.3.29 on my 1GB RAM though, with tweaked mySQL/Apache.)
Title: Re: Php switch doesn't work on a 1GB memory VPS.
Post by: tim on February 05, 2021, 02:24:00 AM
Quote
I am on VPS with 1GB memory and my provider doesn't allow me to manage memory/swaps.
This doesn't make sense; if you have root access, then you can resize/rallocate discs and/or create a swap file. The only exception that I can think of offhand, is OpenVZ;even then a swapfile should be possible,assuming you can write to /etc/fstab.
Otherwise, find another provider.
Forget about clamd/clamav/amavis/spamassasin and you should be fine. (I run PHP5.3.29 on my 1GB RAM though, with tweaked mySQL/Apache.)

Yep. I am exactly on OpenVZ.
And #swapon /swapfile returns me this:
Code: [Select]
swapon: /swapfile: swapon failed: Operation not permittedAny other thoughts?
I found possible solution, but I have no idea where to put it in:
Fix : Adding –disable-fileinfo to ./configure option fixes the issue

Title: Re: Php switch doesn't work on a 1GB memory VPS.
Post by: cinique on February 05, 2021, 11:06:29 AM
Really, OpenVZ isn't worth the hassle, especially if the provider doesn't give you a decent swapfile on a low RAM VPS.
Stick with TinyCP/FastPanel/Keyhelp or similar, on such a crippled VPS.
KVM/LXC are the defacto standards nowadays and I have quite a few that have more than 1GB RAM, that cost <$30/year.
Title: Re: Php switch doesn't work on a 1GB memory VPS.
Post by: Sandeep on February 05, 2021, 11:07:35 AM
if you're building php 7 and above it needs at least 2 gb of ram for openvz