PHP 5.2 is end-of-life (EOL) and extremely outdated. So direct upgrades are not supported (5.2 to 7.4). A backup is mandatory before proceeding and a dev or staging is recommended.
Prerequisites
Access to cPanel or
Access to the Funio Hub
SSH Access
Task completion: depends on expertise
Expertise: advanced
How to do it?
Log in to your cPanel.
In the Software section, choose Select PHP Version.
Check your current PHP version and the PHP extensions you have selected.
Check what your CMS is if you use one
If you have a CMS, check what plugins and themes you are using
Check the PHP requirements
Backup your Website
cPanel > File Manager
Compress and download:
your website root directory (default:
public_html)application folders
Backup database(s):
Audit Application Compatibility
Common incompatibilities
mysql_* functions (removed)
ereg_* functions (removed)
register_globals
magic_quotes
Old constructors (ClassName())
Recommended tools
PHPCompatibility (PHP_CodeSniffer)
CMS upgrade checkers
Test on a staging environment
Recommended Upgrade Path
PHP 5.2 > 5.6 > 7.0 > 7.4
This minimizes fatal errors and simplifies debugging.
PHP Extensions
Ensure the following PHP 7.4 extensions are enabled under Select PHP Version > Extensions
mysqli
pdo / pdo_mysql
curl
json
mbstring
gd
intl
opcache
Replace deprecated functions
PHP 5.2 | PHP 7.4 |
mysql_* | mysqli / PDO |
ereg_* | preg_* |
split() | explode() |
each() | foreach |
Example
#php 5.2
mysql_query($sql);
#php 7.4
mysqli_query($conn, $sql);
Troubleshooting and Common Issues
Enable error logs
Check for fatal errors in deprecated functions
Databases connections errors
Update CMS core
Update plugins/modules
Remove abandoned extensions
Remove outdated and unsupported plugins and themes
Note: If something doesn’t work, you can temporarily switch back to your previous version. If you don’t have experience with this process, we recommend contacting your developer.
