Problems during PHP installation on Zorin 18

I just installed Zorin 18 on my PC and want to download the applications I need. When I tried to download the latest PHP, I got an error during the installation of PHP 8.4-FPM. I asked ChatGPT about it, and it said it's because Zorin 18 already comes with Apache and so on, which I don't really understand, hehehe. Is there anyone who can help me install PHP 8.4? I just want to learn coding as soon as possible.

1 Like

Here is a guide:

ok then, thanks mate. i will try it

Maybe ddev could be something for you. I'm not familar with this topic but in this thread it is recommended for Linux:

No, that didn't work.

Ahhh, ddev, I don't want to use Docker yet, even though ddev doesn't require learning Docker. But I don't just use PHP, I also use React and similar technologies. Are there any other options?

ChatGPT lied to your face: Apache does not come installed by default in Zorin OS.

This is an excellent example of why using ChatGPT & friends while learning is a terrible mistake: you didn't even understood what was going on or whether to tell if the information was accurate or not, or how to even verify it yourself!

Now, this may not always be true about all disciplines, but programming in particular is definitely one of them. I'm not a professional developer, but even I've already seen many people making obvious mistakes that they weren't able to troubleshoot themselves.

My advice: do not use any of these tools until you can build something by yourself. It doesn't have to be the next Facebook or anything, just a simple CRUD application at least.

Which, incidentally, is the next thing that you'll learn how to do with this playlist:

https://www.youtube.com/playlist?list=PLr3d3QYzkw2xabQRUpcZ_IBk9W50M9pe-

How to install PHP is covered in the first few videos. But keep in mind that Zorin OS 18 supports PHP up to version 8.3 — which is still supported, don't worry.

If you plan on using React as well, after you know the basics of PHP, I'd recommend Laravel + Inertia. It will make your life much easier.

What the heck, that's not helpful. I asked ChatGPT when I ran into a problem, AND NOW I CAN'T INSTALL THE PHP FPM EXTENSION. And sorry, I'm not a native English speaker, but your words are very unhelpful and hurtful.

I'm asking here (maybe I didn't explain it very clearly, SO I WON'T BE INSULTED LIKE THIS) why when I install php8.4-fpm there is an error during installation, which should be safe because it's just a download, and I did it on ZORIN 17 and it was fine, but on ZORIN 18 there is an error and I can't tell you what the error code is.

Why is my life like this? I have to ask ChatGPT and similar AI chatbots to resolve this issue quickly. I'm afraid to ask people or the community because of people like this.

I said I've already learned PHP up to Laravel, but why are they giving me basic PHP tutorials? It's so strange.

THANK YOU VERY MUCH MR. KNOW-IT-ALL

My apologies, I didn't mean to be offensive towards you, or insult you. Although I do frown upon the use of ChatGPT for beginners in programming. Perhaps I misunderstood that you were? As you stated that you wanted to learn coding in your first post.

In any case, again, did not mean to come off as harsh as I did.

As for your issue, do you recall the commands that you used to install PHP-FPM? You can run history in the terminal to see the commands that you've run previously.

Is the error not reproducible?

I also experienced the same problem when I failed to install php-fpm versions 8.4, 8.3, and 8.2 on Zorin OS 18. Previously, the setup on Zorin OS 17.3 was smooth and went smoothly. I hope there's a solution soon.

The problem is related to apparmor, when you run journalctl -f and visit any php site you will get an error like this:

Nov 18 02:10:38 akhaled-victus kernel: audit: type=1400 audit(1763421038.334:459): apparmor="DENIED" operation="bind" class="net" profile="php-fpm" pid=57550 comm="php-fpm8.3" family="unix" sock_type="stream" protocol=0 requested="bind" denied="bind" addr="@xdebug-ctrl.57550yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Nov 18 02:10:38 akhaled-victus kernel: audit: type=1400 audit(1763421038.334:460): apparmor="DENIED" operation="open" class="file" profile="php-fpm" name="/var/www/html/info.php" pid=57550 comm="php-fpm8.3" requested_mask="r" denied_mask="r" fsuid=33 ouid=1000

And when you check the rules on /etc/apparmor.d/php-fpm you will see it denies everything by default.However, don't change it, as the file includes custom rule:

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/php-fpm>

TLDR;

sudo nano /etc/apparmor.d/local/php-fpm

Then add

# Allow PHP-FPM to read/write files in /var/www
/var/www/ r,
/var/www/** rwk,
# Allow PHP-FPM to read/write files in custom websites folder
/home/amro/code/ r,
/home/amro/code/** rwk,
/run/php/** w,

Reload apparmor policy

sudo apparmor_parser -r /etc/apparmor.d/php-fpm
sudo systemctl restart php8.3-fpm # optional