PHP Error: Call to undefined function mssql_connect()

Below steps can apply for both mssql_connect() error or mysql error.
First of all by using phpinfo(), check if you have similar like below screen:

phpinfo_mssql
1- Yum

yum search php-mysql or yum php-mssql
yum install freetds "for MSSQL"
yum install freetds-devel.x86_64
yum install unixODBC unixODBC-devel
yum install package_name

2- RPM , by searching online for the required package rpm and install it using following method: (Search for the right rpm for your OS version) (Ex.: Don't install a php-mssql of CentOS 7 on CentOS 6)

rpm -i  downloaded_file_name.rpm

So for my case i was missing the php-mssql so i installed "php56w-mssql",  you can always use below command or phpinfo to verify the module if it's installed:

php -m | grep -i mssql

Still not there ? maybe you need to reconfigure your php, so run the following from the php folder:

./config.nice  --with-mssql=shared,/usr
make
make install

Now be sure that the php.ini file includes the mssql.so extension , to know the location of the original php.ini file you can use below command:

php -i | grep -i php.ini
Configuration File (php.ini) Path => /usr/local/web/php/lib
Loaded Configuration File => /usr/local/web/php/lib/php.ini

Confirm that mssql or mysql is loaded by using:

php -i | grep -i mssql
mssql
MSSQL Support => enabled
mssql.allow_persistent => On => On
mssql.batchsize => 0 => 0
mssql.charset => no value => no value
mssql.compatability_mode => Off => Off
mssql.compatibility_mode => Off => Off
mssql.connect_timeout => 5 => 5
mssql.datetimeconvert => On => On
mssql.max_links => Unlimited => Unlimited
mssql.max_persistent => Unlimited => Unlimited
mssql.max_procs => Unlimited => Unlimited
mssql.min_error_severity => 10 => 10
mssql.min_message_severity => 10 => 10
mssql.secure_connection => Off => Off
mssql.textlimit => Server default => Server default
mssql.textsize => Server default => Server default
mssql.timeout => 60 => 60