centos 6

Connect Sql Server 5.6 from Php in Linux CentOS 6

Posted by admin on March 28, 2016
sql server / No Comments

To connect to SQL Server from Linux use this command to install the driver:

$ sudo yum install -y php-mssql

For example, to php5.6:

$ sudo yum install -y php56w-mssql

This command installs freetds , a collection of libraries to connect to SQL Server from Linux. With this library we can not only connect from Php, but from the command line with the tsql program.

After installing, do not forget to restart apache:

$ sudo apachectl restart

Happy coding 🙂

Tags: , , , , , , ,

Upgrading PHP to 5.6 in linux Centos 6

Posted by admin on March 27, 2016
Php / No Comments

Php by default in Centos 6 may be versión 5.3. If you want to make the most of php with useful functions lie hex2bin, you need the 5.6 version.

In order to upgrade, first we must add the repo, then remove the current version and finally install the new version.

This script contains the commands needed to carry out the tasks:

sudo rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
sudo yum remove php-common
sudo yum install php56w
sudo yum install php56w-mysql
sudo yum install php56w-common
sudo yum install php56w-pdo
sudo yum install php56w-opcache
sudo yum install php56w-pgsql
sudo yum install php56w-pear
sudo yum install php56w-mcrypt
sudo yum install php56w-xml
sudo yum install php56w-xmlrpc
sudo yum install php56w-devel
sudo yum install php56w-pecl-memcache
sudo yum install php56w-gd
sudo yum install php56w-pspell
sudo yum install php56w-snmp
php --version               

With the last line we can verify the success of the upgrade.

Happy coding! 🙂

Tags: , , , , ,