PHP is a general-purpose programming language that was originally designed for web development. According to W3Techs’ data, nearly 80% of all websites that have a known server-side programming language use PHP. That means almost 8 out of every 10 websites on the Internet use PHP in some way. Content management systems (CMS) like WordPress and Joomla or e-commerce solutions like Magento, UberCart, and Zen Cart use PHP to provide a wide array of ready-made solutions to ecommerce websites.
The need to create dynamic and more interactive web pages led to the designing of PHP. Since May 22, 2000, PHP has been the most widely used, open-source, general-purpose scripting language. It is possible to use PHP with almost every operating system including Linux, Microsoft Windows, Mac OS X, and RISC OS. Most hosting providers support multiple versions of PHP, including versions 5.x and 7.x.
So why would anyone need to upgrade something that already works?
When it comes to using the latest PHP versions, many businesses, developers, and hosting providers have fallen behind. Just as it is with any piece of software, PHP has a release life cycle that it adheres to in order to keep making improvements and pushing things forward. Each major release of PHP receives full support for two years after its release. During that time, on a regular basis, bugs and security issues are identified, fixed and patched. Most servers today run and support PHP 5.6 and 7.x. This is evident from the fact that about 57% of websites run on PHP 5.6 or lower. Some use PHP 7.0. However, As of December 3rd, 2018, PHP 7.0 has reached its end of life.
Support for PHP 5.6 ended on December 31st, 2018. This means that these versions of PHP will no longer receive support or updates and would remain exposed to unpatched security vulnerabilities if any were to arise. As of January 2019, a whopping 77.5% of users who currently use these PHP versions will no longer receive any form of support.
These statistics also highlight that a large portion of websites are not taking advantage of additional performance and security enhancements that are available when they upgrade to PHP 7.1 or later versions.
What are the benefits of upgrading to the latest version of PHP?
1. Security
Ensuring that your website runs on a PHP version that receives full support and patches is a step towards ensuring that your website remains secure and technologically up to date. Although some software vendors may still update older versions of PHP, PHP 5.4 has not received patches since 2015. PHP 5.5 has not received patches since 2016. PHP 7 and later versions have new security features built into them. These include stronger hashing and encrypting for storage of sensitive data, and better functionality for identifying content that is potentially dangerous, like malicious code injections, etc. Earlier versions of PHP allowed poor programming practices. However, PHP 7 and above, require a higher standard of coding from its developers. PHP versions 7.2 and later use modern cryptography in their standard library, a step that very few other programming languages have taken so far.
2. Performance
The release of PHP 7.2 and PHP 7.3 ushered in huge performance gains! These gains are so big that they do away with the need to make repeated optimizations to keep your website running optimally. PHP 7 itself, allowed systems to execute twice as many requests per second in comparison to PHP 5.6. The current version, PHP 7.3, executes almost three times as many transactions (requests) per second as compared to PHP 5.6.
3. Support
This is a big reason for using the latest and supported PHP versions. Many developers of plugins and themes can only extend support back for older versions so far. A lot of this is due not having enough time and scope to test the compatibility of the new codes they write with every system out there. Both developers and website owners need to accept that things will eventually break when you run on old versions.
4. New Features for Developers
Most website developers would prefer to work on newer versions of PHP whenever they can, simply because many new features have been added between PHP 5.2 and PHP 7.3. These changes go a long way towards making the latest version of PHP, faster and more secure while providing additional flexibility to build better solutions.
How do I check the PHP version my website uses?
Checking the PHP version your website uses is easy. You could follow any of the methods below
Check the administrator panel of your hosting
Log in to the administrator panel of the hosting the website you wish to check. In most administrator panels, the stats of your hosting account are displayed in the menu bar on the left of the page. Among other server information and stats, the PHP version installed on the server used to host your website will be displayed. If you do not find the details you need in the left menu, look for the PHP Info tab and visit the PHP Info section to check for this information.
Use the phpinfo.php file to determine PHP version
An easy way to determine the PHP version your website is running on is to create a phpinfo.php file and upload it to your web hosting using an FTP. You can use any text editor, like notepad, to create this file. After you open a new file, paste the codes provided below in the file and save it. The codes you need to paste in the file are –
<?
phpinfo();
>
Save the content to the file and upload it to your web hosting. After you have uploaded the file, visit your website, and add the name of the file after the domain name. The link in the address bar of your browser would look similar to – http://www.mywebsitesname.com/ phpinfo.php. The PHP version will show on the screen.
Use the ‘Developer Tools’ option in a web browser
This method could be a bit tricky. However, if you go a step at a time, you can determine the PHP version. Most popular web browsers provide developers with additional tools that they can use to diagnose issues that prevent information from loading properly on a web page. You could use this tool to determine the version of PHP that your website runs on. You would need to follow the steps outlined below to achieve this goal:
- Open a web browser. If you already have a web browser open, open a new tab in the same browser.
- Press F12 to access Developer Tools. You could also use the combination of the Ctrl + Shift + I to access these tools.
- Locate the ‘Network’ tab in the developer tools.
- Put your domain in the address bar of the browser and visit your website.
- In the Developer tools section, you will see certain details loading.
- At the top of the list in the ‘Network’ tab, you will see the domain name of your website; click on it.
- In the pop-out that opens, locate the entry for ‘X-Powered-By’. You will find this entry in the under ‘Response Headers’.
- The PHP version your website runs on will show in front of the ‘X-Powered-By’ entry.
Use an online tool to determine PHP version
You can look for and use a few tools available online to determine the PHP version your website runs on. Although many hosting servers prevent third-party tools from collecting information about the PHP version because hackers can use this information to compromise a website, you could still try it out. One such tool is https://sitecheck.sucuri.net. You can visit this link, put your domain name in the ‘scan website’ box, and click on the Scan Website button. If the information is retrievable, it will show on the scan results page.
Talk to the developer of your website
Your developer may know or can check your website and provide you with information about the PHP version your website runs on.
The PHP version my website runs on is old. Do I just update it? Will everything be good?
Good question, unfortunately, there is no simple “Yes” or “No” answer to this one. If your website is old, or if the PHP version that your website runs on is below PHP version 7.X you will need to test all the codes of your website and make the necessary changes required to ensure that they are compatible with the latest version of PHP. The developer of your website, or your own team of developers, will be able to provide you with an idea of the scope of work required to update your website. If your website uses an ecommerce platform or a CMS platform, updating it may involve checking each of the plugins used by the website, the theme and the version of the CMS platform itself, to ensure that all of them are compatible with the updated PHP version. Although some plugins or themes may not be compatible, there are many others available that you could use to replace out the incompatible components.
Conclusion
Using the latest PHP versions is important not only for security reasons but also for better performance and support. The path to unbridled ecommerce success is easy to travel on when you take all steps to ensure every component of your website is technologically up to date. Collaborating with a seasoned professional website developer like QualDev Inc. is the best way to ensure that your website performs properly and you experience the minimum of losses due to any form of website downtime.
Even the PHP Group themselves give some feedback about staying current in the PHP Manual: PHP, like any other large system, is under constant scrutiny and improvement. Each new version will often include both major and minor changes to enhance security and repair any flaws, configuration mishaps, and other issues that will affect the overall security and stability of your system.
Like other system-level scripting languages and programs, the best approach is to update often, and maintain awareness of the latest versions and their changes.