I am having trouble upgrading one of our client websites to the newest stable release of Wordpress, version 5.2. It will not allow me to upgrade the website on account of the site still running on an outdated version of PHP (5.538). If I do try to update the PHP version to anything above the current, the site functionality breaks.
Hariprasad Vijayan answers:
Are you getting any error after updating PHP version to 7.x?
WordPress is loading? If not make sure mysql modules are enabled correctly after PHP updation.
If WordPress loads and the theme is not running correctly, then change theme and check.
Are you using custom WordPress theme? Which shows broken result? then you might need to update theme. There might be some codes/functions that is not compatible with PHP 7.x
Paul Maurer comments:
hi - to answer your questions:
- This is a two-fold problem. I cannot upgrade to 5.2 without first upgrading the PHP version. However, when I upgrade to PHP 7.0, the website goes completely blank, white screen.
- The theme is completely customized with a lot of custom coding - base theme before customization is called Avada, version 3.7.1
Hariprasad Vijayan comments:
Try this, Change theme to a default WordPress theme and do upgrade PHP and WordPress upgrade. If it works, then the custom code in the theme creates some conflicts and it need to update.
Sai kumar answers:
There are a couple of methods which will help you to solve the current issue.
If the server is not shared hosting one, then please try upgrading the PHP to 7 and then restart the server and make sure the DB and the server is working fine, you can check this through the shell access if you have. Once this is done, please update WordPress to the latest version and check the website whether it is loading or not. If it is not loading, then please enable debug mode in wp-config.php and try loading the website, and you will get the proper error report there, probably few of the functions may be deprecated. Then fix those and everything will be fine.
Method 2 (safest method)
Take the current website backup including DB and setup your localhost to the latest PHP or the one which you are going to use in the live server and configure the website in your localhost and then do the update and then you can easily fix the errors and once it is fixed you can just migrate to the server.
In case if you need any help in the configuration or debugging, you can reach me at any given point of time.
Looking back to hear from you.
Hugo Gonçalves answers:
1- Download a copy of the website (might use this plugin: https://wordpress.org/plugins/duplicator/) to a local server running PHP 7+, and activate debugging in the wp-config.php file, by changing
define( 'WP_DEBUG', false ); to
define( 'WP_DEBUG', true );
See more about debug here: https://codex.wordpress.org/Debugging_in_WordPress
2- See what errors the debug spits out and eliminate them
3- Upload the corrected theme
4- Change the server PHP version
5- Update Wordpress, hopefully without any problems, to upgrade it without any surprises for now, since its an old website, you might want to add this plugin: https://wordpress.org/plugins/classic-editor/
Hope this can be of any help.
Cesar Contreras answers:
- Make a backup of your site (Database, templates, plugins and wp-uploads) is always the main thing.
- Update your version of PHP
- Uninstall all your plugins
- Update your WordPress if you do not have it updated
- First confirm that the default template works well.
- Install your template and its plugins one by one.