Php switch doesn't work on a 1GB memory VPS.

Started by tim, February 05, 2021, 01:09:50 AM

Previous topic - Next topic

tim

I can not switch from 5.6.37 to ANY other version higher than 5.
Tried different options such as:

  • OS versions Centos 7 And 8
  • Installing fresh CWP with keys --phpfpm 7.4, 7.3 etc.
  • Switching off most services to increase memory
Log ends with:

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


cinique

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.)

tim

#2
Quote from: cynique 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.)

Yep. I am exactly on OpenVZ.
And #swapon /swapfile returns me this:
swapon: /swapfile: swapon failed: Operation not permitted
Any 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


cinique

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.

Sandeep

if you're building php 7 and above it needs at least 2 gb of ram for openvz