Ondřej's PPA and support for non-LTS, Ubuntu 21.10

Non-LTS releases will not be supported by the Ondřej PPA from 22.04 onward, but here is why you probably do not need it anyway.

346 views
d

By. Jacob

Edited: 2021-11-05 10:46

FTR I will do the Ubuntu 21.10 as the last non-LTS release and after Ubuntu 22.04, only LTS releases will be supported by this repository.

— Ondřej

Ondřej just posted this comment on GitHub saying that non-LTS releases will not be supported by his PHP PPA after Ubuntu 22.04 — of course we are still a few months away from April 2022, when 22.04 will be released, but what can you do after this?

I decided to finally move my development environment to a VM; among other things, this allows me to just shut down the entire thing whenever I do not need it. Obviously it makes no sense to run a local MySQL- and web server, when you are playing a video game or doing other things on your system.

But, as one commenter noted, some computers are not powerful enough to run virtualization. While it is true in many cases, I also think we often tend to underestimate the resources needed to run a VM; for example, I have been using an old i3 laptop, and it was able to run VMs in Virtual Box just fine. But, it is obviously dependent on what you are going to run in your VM. I just run a headless box, without a desktop environment, and then I SSH into it as needed.

Support for non-LTS releases

In case you have not noticed, over at GitHub we had a small discussion with Ondřej Surý about adding support for Ubuntu 21.10 for the PHP PPA — I more or less randomly joined, but it was still interesting.

Note. If you rely on the PPA, remember you can support Ondřej's work on Patreon: https://patreon.com/oerdnj.

More info: https://github.com/oerdnj/deb.sury.org

My local development environment

I hope your Production environment is running the LTS, because there is rarely any reason to run the normal releases.¨; for a local system there can be plenty of reasons to run the latest, however.

Previously I have updated my system whenever a normal release became available, without big issues — this time it was different — basically my developer-environment broke.

I normally rely on having multiple PHP versions installed, and while doable manually, Ondřej's PPH just makes it a lot easier. After upgrading to Ubuntu 21.10, I was not even able to properly install PHP 8.0 from the official repositories due to broken dependencies.

Of course, there are solutions to such issues, but they tend to be a bit complicated, and, they can lead to other issues — this is why it is probably best to avoid them entirely from the start.

You are warned about this stuff constantly, nevertheless, I still wanted to update so I could use a more recent Linux Kernel in the hope that it might improve support for my Ryzen 7. The main reason was that I was trying a Windows 10 VM in Virtual Box, and it had some strange issues when enabling 3D acceleration that I hoped might have been solved by updating the Kernel (they were not).

I have since solved this issue by switching to VMWare for my Windows VM, and it runs incredibly well aside from some occasional sound crackling — which I have almost also completely solved.

Moving to a VM

Long story short, I decided to install my Server environment in a Virtual Box VM instead of running it directly on my host OS — doing this not only allows me to run a different distribution or OS as host, it also increases security!

The best thing is, I can even run this VM with minimal RAM, CPU and hard disk space.

For example, I can limit the virtual HDD because I have configured a shared directory with the host OS; this even works if you run MySQL, because you can just move the MySQL data files to the shared folder. I have not actually done the last part yet, since I do not need that much space, yet, but it should be doable very easily. Apparently symbolic links are disabled by default, so you have to enable that if you need to add sym links.

Re-installing the system

If you ever need to re-install or change to another OS, you still have your VM files, which are easy to backup — and because you have setup a shared folder with the host OS, those VM files are not too large to move around.

The guest OS itself is not going to contain any content or files, except for system files needed to run the environment. Everything should be stored in the folder shared with your host.

Tell us what you think:

  1. The best way to deal with a trailing question mark is probably just to make it a bad request, because it is a very odd thing to find in a request URL.
  2. This happens when trying to access methods on objects that are not instantiated. Always check if an object is instantiated before trying to use it.
  3. Tutorial on how to use proxy servers with cURL and PHP
  4. How to determine an optimal value for pm.max_children and related php-fpm settings for your server and web applications.
  5. PSR-1 does not permit underscores for method names, but it probably should. Also, class names most use StudlyCaps.

More in: PHP