Friday, November 7, 2014

php pdo driver not found

php connect to mssql database on Linux using pdo: driver not found
php pdo mssql driver installation on centos and ubuntu

If you are using CentOS, fedora or RHEL, Run commands
sudo yum install php-pdo
sudo yum install php-mssql
sudo yum install freetds-devel libxml2-devel
If you are using Debian or Ubuntu, Run

sudo apt-get install php5-dev php5-mysql php5-odbc php5-sybase libmysqlclient-dev freetds-dev

dblib is needed on Linux to connect to mssql server using pdo.

Here is php code to connect to ms sql server from Linux Apache using pdo.
<?php
$dsn = 'dblib:dbname=testdb;host=127.0.0.1';
$user = 'dbuser';
$password = 'dbpass';
$dbh = new PDO($dsn, $user, $password);
?>
Now try to connect MS SQL server.

mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ffi-1.9.6 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ffi-1.9.6/ext/ffi_c/gem_make.out


If you are using CentOS, fedora or RHEL, Run command
sudo yum install ruby-devel
If you are using debian or ubuntu, Run command
sudo apt-get install ruby-dev

nodejs npm - Fatal error: unable to find local grunt

Fatal error: unable to find local grunt

You need to install grunt on your system.
All the explanations are here.

To solve this problem, Run following command in terminal :
npm install -g grunt-cli
npm install grunt --save-dev
npm install grunt-cli