How to check the PHP version on Linux

 For checking  and validate PHP version on Linux follow below step

 Open a bash shell terminal and use the command “php –version” or “php -v” to get the version of PHP installed on the system.


# php --version

PHP 5.4.16 (cli) (built: Mar  7 2018 13:34:47) 

Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies


# php -v

PHP 5.4.16 (cli) (built: Mar  7 2018 13:34:47) 

Copyright (c) 1997-2013 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies


How to List Compiled PHP Modules from Command Line

If your server only has a single PHP version installed, you can run this PHP command anywhere, and it will give you the same list of modules. The general command we will be using is php -m. This command will give you the full list of installed PHP modules/extensions.

root@host [~]# php -m

This command will give you an output similar to the following information.

bcmath

bz2

Core

ctype

curl

date

dom

exif

fileinfo

filter

ftp

gd

hash

iconv

imagick

json

libxml

mbstring

mysqli

mysqlnd

openssl

pcntl

pcre

PDO

pdo_mysql

pdo_sqlite

Phar

posix

readline

Reflection

session

SimpleXML

SPL

sqlite3

standard

tokenizer

wddx

xml

xmlreader

xmlwriter

xsl

zip

zlib


[Zend Modules]






No comments:

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...