Update the installed packages.
yum update
Install the REMI repository.
# CentOS/RHEL 6
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-6.rpm
# CentOS/RHEL 7
rpm -Uvh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Check that the repositories are correctly installed.
yum repolist
In this case, PHP 7.0 and 7.1 will be installed.
# PHP 7.0
yum install php70 php70-cli
# PHP 7.1
yum install php71 php71-cli
sudo su
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
exit
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install msodbcsql
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y yum install mssql-tools
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo yum install unixODBC-devel
# PHP 7.0
yum install php70-php-sqlsrv
# PHP 7.1
yum install php71-php-sqlsrv
- The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
- Description: Usually this is caused by querying the database with a login that uses a language setting with a different date format from the one that is being sent from the driver. Use the DBCC USEROPTIONS to validate this and change the user language accordingly.
- References: 1