First check your version with php -v. Then, update it using your system’s package manager:
- Ubuntu/Debian: sudo apt update && sudo apt install php
- CentOS/Fedora: sudo dnf install php
- Windows: Download the latest PHP version from php.net, extract it, and update your system’s PATH.
After updating, verify with php -v and restart your web server (sudo systemctl restart apache2 or nginx). Let me know if you need help with specific configurations!