What are the differences between updating PHP on shared webspace versus a dedicated server?

When updating PHP on shared webspace, you typically do not have direct control over the server settings and configurations. This means that you may need to contact your hosting provider to update PHP for you. On the other hand, with a dedicated server, you have full control over the server settings and can easily update PHP yourself.

// Example code snippet for updating PHP version on a dedicated server

sudo apt-get update
sudo apt-get install php7.4
sudo service apache2 restart