Author Topic: Php switch doesn't work on a 1GB memory VPS.  (Read 4952 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Php switch doesn't work on a 1GB memory VPS.
« 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:
  • 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:
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


Re: Php switch doesn't work on a 1GB memory VPS.
« Reply #1 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.)

Offline
*
Re: Php switch doesn't work on a 1GB memory VPS.
« Reply #2 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

« Last Edit: February 05, 2021, 02:34:25 AM by tim »

Re: Php switch doesn't work on a 1GB memory VPS.
« Reply #3 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.

Offline
*****
Re: Php switch doesn't work on a 1GB memory VPS.
« Reply #4 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