Seems you have installed PHP in some other way, you can try to remove/uninstall that version and then install the homebrew version. If you are not able to remove the old version you can have both installed, just make sure the path to the homebrew version comes before the old php path in the PATH environment.
Thanks, Patrick, but I don't understand anything anymore and I think the various attempts have made it worse.
The PHP version appears to be the following:
And the address is this:

Do you still use some old MacOS version, I believe they removed all those legacy dependencies like PHP, Python etc. from the OS.
It seems to be difficult to uninstall that version from what I've searched, the best way is to simple install latest PHP with brew and then adjust the PATH variable to make sure the brew binaries come first. I believe brew binaries are located at usr/local/bin, so that has to come before usr/bin.
Depending on the MacOS version you have to edit one of the configuration file .bashrc or .zshrc.
https://techpp.com/2021/09/08/set-path-variable-in-macos-guide/
I'm forced to use Mac Big Sur because my Mac no longer accepts operating system updates.
Sooner or later I'll have to buy a new one, but not now.
Now

If I understand correctly, I should somehow be able to delete the current PHP version (7.3.29) from the Mac in order to then install a new PHP version (the one used by the server) with Wappler.
So the big problem is that every action I perform in the Mac terminal fails, always due to some error message

What I didn't understand and what I would like to know, if possible, is whether there is a possibility of updating PHP to a new version with a Mac that has the Big Sur 11 operating system
From what I've read about the PHP version supplied with MacOS is that it is difficult to remove. I think it is best to leave it there and install the latest PHP with brew. You then have to configure your shell config to have the brew installation first in the PATH variable.
You can check with which php which executable it picks, which -a php shows all php executables. If it picks the wrong one the order in the PATH is incorrect.
Thanks, Patrick,
but I'm still having trouble doing this.
To get started, I try running which -a php in the terminal, but it doesn't give me any results. I should check the list of loaded PHP versions, but none appear.

It only sees the system PHP, did you install it using brew install php?
Did the above work then check again, you could also use php -v to see which php version is being used.
If it is installed but it does execute the incorrect one you could first try brew link php --force.
If the brew version did install and which -a php show 2 paths but in the wrong order then you have to edit the shell configuration to edit the PATH variable.
Mac OS Big Sur 11
Thanks, Patrick
So if I understand your suggestions correctly, you should proceed as follows:
-1
Leave the current obsolete version without attempting to delete it
-2
Install a new PHP version (perhaps 8.2) using
brew install php 8.2
But an error always appears, and therefore the download doesn't work
-3
Check if the new version is installed and
then change the path
But if I can't install the new version, I can't proceed.
The two screenshots don't seem to give sufficient answers, so I ask you: for these procedures is it better to use the Mac terminal or the Wappler one??????
First install the latest php:
brew install php
After installing PHP, you need to link it so that macOS uses it as the primary version:
brew link php
If another version is already linked, you can force the link with:
brew link --overwrite --force php
George
That's what I'm trying to do.
I updated homebrew and then set brew install php@8.0.
But it always gives an error.
Let me explain better.
brew install php
a warning and an error always appear
brew link php
ERROR

brew link --overwrite --force php
ERROR

php -ver
???
The download error shows that the ssl handshake failed. It looks like LibreSSL/2.8.3 is installed and used, this is an very old version from 2018.
Try to run this before the brew commands:
export HOMEBREW_FORCE_BREWED_CURL=1
I tried, but apparently nothing changed.
I still get an error reading the Libzio 1.11.4 library.
I downloaded the library from Interbet, but I don't know how to use it.
If I'm not mistaken, the SSL setting depends on which server you use and therefore it may or may not work depending on the domain you are working on.
If I use Wappler terminal every brew command gives error zhs Command not foun
Maybe this is the problem?
@George
I've tried everything I can, but unfortunately I haven't been able to fix the PHP update.
It's not the right time to buy a new Mac, and I can't update my iMac beyond Big Sur 11.7.9, so if I don't find a solution, I'll be forced to use an older version of Wappler and skip updates.
Which version can I use, and where can I find it?
And will I have problems with projects that have been updated recently?
If you downgrade you should probably also downgrade your host since several of the old server connect modules will not work on PHP 8.4.
You can try other install methods like MacPorts or a different brew package.
Instead of using the internal PHP server you could also install something like XAMPP or an other alternative for development.






