install php8.1

install php8.1
https://computingforgeeks.com/how-to-install-php-on-ubuntu-linux-system/
install php8.1-fpm + apache
https://www.cloudbooklet.com/how-to-install-php-fpm-with-apache-on-ubuntu-20-04/

 

switch php version

Apache:

$ sudo a2dismod php5.6
$ sudo a2enmod php7.1
$ sudo service apache2 restart

Command Line:

$ sudo update-alternatives --set php /usr/bin/php7.1
$ sudo update-alternatives --set phar /usr/bin/phar7.1
$ sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1

php-for-windows

  1. setx PHPRC "C:\YourPathto\PHP7\php.ini"
    You should see SUCCESS: Specified value was saved.
  2. Then restart your computer (really).
  3. Or edit environmental variables through the regular way, then restart:

 

  1. cmd -> env
  2. PATH
  3. C:/YourPathto/PHP7 & C:/YourPathto/PHP7/ext

 

The PHPRC (PHP Runtime Configuration) environment variable is one way to tell PHP where to find the main php.ini file. It can sometimes be used to change the location of the main php.ini file.
Reference: http://php.net/configuration.file

https://webmasters.stackexchange.com/questions/102131/what-does-setenv-phprc-do-and-how-is-it-used

local ssl certificate

  1. Similar for other environment
    • download and extract for cacert.pem here (a clean file format/data)

https://curl.haxx.se/docs/caextract.html

  1. Put it here in the following directory.

C:\xampp\php\extras\ssl\cacert.pem

  1. In your php.ini put this line in this section (“c:\xampp\php\php.ini”):
;;;;;;;;;;;;;;;;;;;;
; php.ini Options  ;
;;;;;;;;;;;;;;;;;;;;

curl.cainfo = "C:\wamp\bin\php\extras\ssl\cacert.pem"
  1. Restart your webserver/apache
  2. Problem solved!

install php7.3

https://websiteforstudents.com/install-php-7-3-php-7-3-fpm-with-apache2-nginx-on-ubuntu-16-04-18-04-18-10/

php version

what PHP version your Apache server is using, 
the output of phpinfo() is always what you should pay attention to
sudo a2dismod php7.1
sudo a2enmod php7.3
sudo service apache2 restart

Install Composer

https://www.ionos.com/community/hosting/php/install-and-use-php-composer-on-ubuntu-1604/

windows 10
https://devanswers.co/install-composer-php-windows-10/