Determine the version of PHP running a website via PHP code
Setup a PHP Info file
It's possible to create a very simple file that you can upload to your web space that will output a list of environment settings about your web server's PHP environment. This step requires that you have access to upload a file to your public web space (either via FTP or a Control Panel website).
If you are at all uncomfortable uploading a file to your live website it is probably time to either
- Contact your internet service provider for help to determine your PHP version
- Find a developer to help you clarify this and undertake any update required.
Creating a phpinfo script
Assuming you are comfortable uploading a file to your web hosting just follow these very simple steps...
- Create a text file on your computer containing only the following line of code within it:
<?php phpinfo(); ?>
- Save the file as something unique that ends with the .php extension. For example myphpversion.php
- Copy this file up to your web hosting space
- Now access it via a web browser at your domain name. Ie: http://yourdomain.com/myphpversion.php
- You should now see a white page with a large purple table. At the top of this your exact PHP version will be shown.
- Finally, very importantly; delete the file you just uploaded!
Do you now know your PHP version?
Now that you know what version of PHP your server is running do you need to upgrade it? Check by reading this article
If you are still having problems working out your PHP version it's probably time to call for some professional PHP developer help
Article last updated: 22nd October, 2020