Open aaugusto-kelmar opened 6 months ago
Maybe the machine you're using doesn't have enough specs (especially memory)? I am using Phalcon in a Docker container, and have had the experience of completing compilation by increasing the memory allocated to WSL2 (as a result, increasing the container's memory). This post states that at least 3Gb of memory is required.
@niden and I were working on a PHP 8.3 build issue and I confirmed that PECL does not work on a small server. I was trying to install with PECL on a 1CPU/2GB server and PECL was failing. When I upgraded to a 2CPU/4GB server, PECL installed Phalcon as expected.
Confirm that build log is full of warnings like summary notes, building it for Alpinelinux http://build.alpinelinux.org/buildlogs/build-edge-x86_64/testing/php81-pecl-phalcon/php81-pecl-phalcon-5.6.0-r0.log
Try to run (in screen or separate terminal window the next script after starting the build:
#!/bin/bash
while :; do
cc1_pids=$(pgrep cc1)
for pid in $cc1_pids; do
if ! pgrep -P $pid cpulimit; then
echo "Limiting CPU usage for process $pid"
sudo cpulimit -p $pid --limit=80 --background
fi
done
sleep 5
done
@niden maybe it's possible to limit the resource usage through config or better via command line parameter?
Also check memory, and if it's less than 4GB (cheapest VDS on Hetzner now has 4GB) and there is no swap (i.e. empty output of sudo swapon --show
) probably it's time to add swap file before the build:
sudo fallocate -l 4G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
The VPS I use has 2GB of memory allocated to it, and according to the results of the free command, 2GB of swap was also assigned. I tried installing it with pecl, and the installation completed without any problems. I haven't tested it thoroughly yet, so I don't know if it works completely. This is because I seem to have seen reports that when installing with pecl in an environment with insufficient memory, "it works for the most part, but some parts don't work." I hope I'm remembering it wrong.
yes, 4GB ram+swap or above should work. In my config it fails with 3,7GB RAM without swap.
Nowadays, VPSs often use SSD storage, so I think it has become easier to use swap than before. If you can specify the swap yourself, it is very convenient to be able to compile even on an inexpensive VPS with little RAM. I also have a VPS with 1GB of RAM allocated to it, so I would like to try to see if I can compile on that VPS someday.
It would be great if you could install the executable file from the Phalcon official website, but unfortunately this is not possible these days. sury.org is available, but it is unfortunate that it is not the latest version.
The only thing I can offer for memory issues is this post in Stack Overflow
The original post was taken down, but I have the archive.org link.
I had a similar issue with bitbucket pipelines compiling Phalcon from source and I ended up compiling it without having the mysql service enabled.
So based on past cases and observations, what is needed is 4GB "including swap", right?
It would be nice if we could get the latest executable file in some repository. This is generally the easiest way.
Describe the bug When installing via PECL (and also when trying to install with the install script in the build directory), the install gets stuck in a loop spitting out the following error:
To Reproduce
Expected behavior Phalcon installed successfully
Details
Additional context Install was working last week but as of Friday it stopped working and would encounter this error.