centos

Connect Sql Server 5.6 from Php in Linux CentOS 6

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

To connect to SQL Server from Linux use this command to install the driver:
[bash]
$ sudo yum install -y php-mssql
[/bash]

For example, to php5.6:
[bash]
$ sudo yum install -y php56w-mssql
[/bash]

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:
[bash]
$ sudo apachectl restart
[/bash]

Happy coding 🙂

Tags: , , , , , , ,

Upgrading PHP to 5.6 in linux Centos 6

Posted by admin on March 27, 2016
Php / 2,984 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:

[bash]
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
[/bash]

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

Happy coding! 🙂

Tags: , , , , ,