How to check PHP version of your server ?


You can check Php Version using phpinfo file. You can create phpinfo.php from your Cpanel >> Filemanager Or You can crete it through shell also(if you have the access).
1) Create a phpinfo.php file under your public_html folder for respective host.
2) Edit phpinfo.php file using any editor like vi. add below code in the phpinfo.php file
Code:
< ?phpinfo();?>
Close and save the file
3) Permissions should be 644 for phpinfo.php. You could change the permission using the code given below.

Code:
chmod 644 phpinfo.php
4) Ownerships should be user:user. You could change the permission using the code given below.
Code:
chown username:username phpinfo.php
5) If you are using cPanel >> Go to Filemanager and create phpinfo.php file. Insert the phpinfo script as updated above, save the file then change the permission easily from the "permission" tab provided by cPanel.
6) Now check the php version of your host using link
http://domainname/phpinfo.php
Note : If server already has PHP5 installed.
5) If "http://domainname/phpinfo.php" which displays the version PHP 4 and you want to upgrade it php5
6) Then Create .htacess file under your public_html folder for respective domain.
7) Edit with your favorite editor and add following code in the .htaccess file.
Code:
AddHandler application/x-httpd-php5 .php
8) Permissions should be 644 for .htaccess. You could change the permission using the code given below.
Code:
chmod 644 .htaccess
9) Now visit "http://domainname/phpinfo.php" It should display the PHP 5 version.

Pages