What potential issues can arise when migrating a PHP application to a new server?

One potential issue that can arise when migrating a PHP application to a new server is compatibility issues with different PHP versions or configurations. This can lead to errors or unexpected behavior in the application. To solve this, it is important to ensure that the new server has the same PHP version and configurations as the original server.

// Check PHP version compatibility
if (version_compare(PHP_VERSION, '7.2.0') < 0) {
    die('PHP version 7.2.0 or higher is required');
}