Installing PHP-MSSQL on CentOS 6

I'm having difficulty getting php-mssql on my CENTO 6.6 server. I have been working with Hostmonster support and this is what they've told me to do...

rpm -ivh http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
 
cd /etc/yum.repos.d/
wget http://rpms.famillecollet.com/enterprise/remi.repo
 
yum install freetds
yum install freetds-devel
yum install --enablerepo=remi php-mssql

Everthing loaded except the last line, which returned the following...

root@server.michaelfinocchio.com [~]# yum install --enablerepo=remi php-mssql
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * remi: mirrors.mediatemple.net
 * rpmforge: mirror.webnx.com
No package php-mssql available.
Error: Nothing to do
root@server.michaelfinocchio.com [~]#

Can anyone assist in helping me get this install so I can connect to my remote MSSQL Server?

Thanks,
Mike
mfinoccAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Zephyr ICTCloud ArchitectCommented:
You could try with:
yum install -y --enablerepo=remi,remi-php56 install php-mssql

Open in new window

0
mfinoccAuthor Commented:
Didn't work; see below...

root@server.michaelfinocchio.com [~]# yum install -y --enablerepo=remi,remi-php56 install php-mssql
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * remi: mirrors.mediatemple.net
 * remi-php56: mirrors.mediatemple.net
 * rpmforge: mirror.webnx.com
remi-php56                                                          | 2.9 kB     00:00
remi-php56/primary_db                                               | 182 kB     00:00
No package install available.
No package php-mssql available.
Error: Nothing to do
root@server.michaelfinocchio.com [~]#
0
Zephyr ICTCloud ArchitectCommented:
Weird, should be there:
http://rpms.famillecollet.com/enterprise/6/php56/x86_64/repoview/php-mssql.html

To be sure, can you run this:

# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Open in new window


Just to make sure you have all that correctly set ..
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

mfinoccAuthor Commented:
Okay, those ran...

root@server.michaelfinocchio.com [~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Preparing...                ########################################### [100%]
   1:remi-release           warning: /etc/yum.repos.d/remi.repo created as /etc/yum.repos.d/remi.repo.rpmnew
########################################### [100%]
root@server.michaelfinocchio.com [~]#

What next?
0
Zephyr ICTCloud ArchitectCommented:
First run:

yum update

Open in new window


Next try this:

yum install -y --enablerepo=remi.repo.rpmnew,remi-php56 install php-mssql

Open in new window

Or
yum install -y --enablerepo=remi.repo.rpmnew install php-mssql

Open in new window

0
mfinoccAuthor Commented:
Ran the commands above; here is the result...

root@server.michaelfinocchio.com [~]# yum update
Loaded plugins: fastestmirror, security
Setting up Update Process
Loading mirror speeds from cached hostfile
 * rpmforge: mirror.webnx.com
Resolving Dependencies
--> Running transaction check
---> Package dracut.noarch 0:004-356.el6_6.1 will be updated
---> Package dracut.noarch 0:004-356.el6_6.2 will be an update
---> Package dracut-kernel.noarch 0:004-356.el6_6.1 will be updated
---> Package dracut-kernel.noarch 0:004-356.el6_6.2 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch          Version                Repository      Size
================================================================================
Updating:
 dracut               noarch        004-356.el6_6.2        updates        123 k
 dracut-kernel        noarch        004-356.el6_6.2        updates         25 k

Transaction Summary
================================================================================
Upgrade       2 Package(s)

Total download size: 148 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): dracut-004-356.el6_6.2.noarch.rpm                 | 123 kB     00:00
(2/2): dracut-kernel-004-356.el6_6.2.noarch.rpm          |  25 kB     00:00
--------------------------------------------------------------------------------
Total                                           7.0 MB/s | 148 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : dracut-004-356.el6_6.2.noarch                                1/4
  Updating   : dracut-kernel-004-356.el6_6.2.noarch                         2/4
  Cleanup    : dracut-kernel-004-356.el6_6.1.noarch                         3/4
  Cleanup    : dracut-004-356.el6_6.1.noarch                                4/4
  Verifying  : dracut-004-356.el6_6.2.noarch                                1/4
  Verifying  : dracut-kernel-004-356.el6_6.2.noarch                         2/4
  Verifying  : dracut-004-356.el6_6.1.noarch                                3/4
  Verifying  : dracut-kernel-004-356.el6_6.1.noarch                         4/4

Updated:
  dracut.noarch 0:004-356.el6_6.2     dracut-kernel.noarch 0:004-356.el6_6.2

Complete!
root@server.michaelfinocchio.com [~]# yum install -y --enablerepo=remi.repo.rpmnew,remi-php56 install php-mssql
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * remi-php56: mirrors.mediatemple.net
 * rpmforge: mirror.webnx.com
No package install available.
No package php-mssql available.
Error: Nothing to do
root@server.michaelfinocchio.com [~]# yum install -y --enablerepo=remi.repo.rpmnew install php-mssql
Loaded plugins: fastestmirror, security


Error getting repository data for remi.repo.rpmnew, repository not found
root@server.michaelfinocchio.com [~]#

What next?
0
Zephyr ICTCloud ArchitectCommented:
That's weird ...

Can you post outcome of :
ls  /etc/yum.repos.d/

Open in new window


If all else fails we can install the package manually but we'll see ...
0
mfinoccAuthor Commented:
See below...

root@server.michaelfinocchio.com [~]# ls  /etc/yum.repos.d/
CentOS-Base.repo         epel.repo                 remi.repo
CentOS-Base.repo.rpmnew  epel.repo.rpmnew          remi.repo.1
CentOS-Debuginfo.repo    epel-testing.repo         remi.repo.rpmnew
CentOS-fasttrack.repo    mirrors-rpmforge          rpmforge.repo
CentOS-Media.repo        mirrors-rpmforge-extras   UL_hostmonster.repo
CentOS-Vault.repo        mirrors-rpmforge-testing  UL.repo
root@server.michaelfinocchio.com [~]#

What next?
0
Zephyr ICTCloud ArchitectCommented:
That's a lot of repos ...

I think we're beyond the use of repos/yum ... I found this webpage that walks through installing it manually (from source), I guess that's the only one left that should work...
0
mfinoccAuthor Commented:
I started run the commands from the webpage above. I got stuck here...

root@server.michaelfinocchio.com [libmcrypt-2.5.8]# wget ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz
--2015-04-29 18:13:49--  ftp://ftp.astron.com/pub/freetds/stable/freetds-stable.tgz
           => “freetds-stable.tgz”
Resolving ftp.astron.com... 38.117.134.18
Connecting to ftp.astron.com|38.117.134.18|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/freetds/stable ... done.
==> SIZE freetds-stable.tgz ... done.
==> PASV ... done.    ==> RETR freetds-stable.tgz ...
No such file “freetds-stable.tgz”.

root@server.michaelfinocchio.com [libmcrypt-2.5.8]#

What now?
0
Zephyr ICTCloud ArchitectCommented:
0
mfinoccAuthor Commented:
I used this link and got this result...

root@server.michaelfinocchio.com [libmcrypt-2.5.8]# wget ftp://ftp.astron.com/pub/freetds/stable/freetds-0.91.112.tar.gz
--2015-04-29 18:25:22--  ftp://ftp.astron.com/pub/freetds/stable/freetds-0.91.112.tar.gz
           => “freetds-0.91.112.tar.gz”
Resolving ftp.astron.com... 38.117.134.18
Connecting to ftp.astron.com|38.117.134.18|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/freetds/stable ... done.
==> SIZE freetds-0.91.112.tar.gz ... 2374916
==> PASV ... done.    ==> RETR freetds-0.91.112.tar.gz ... done.
Length: 2374916 (2.3M) (unauthoritative)

100%[==============================================================>] 2,374,916    687K/s   in 3.4s

2015-04-29 18:25:26 (687 KB/s) - “freetds-0.91.112.tar.gz” saved [2374916]

root@server.michaelfinocchio.com [libmcrypt-2.5.8]# tar zxvf freetds-stable.tgz
tar (child): freetds-stable.tgz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
root@server.michaelfinocchio.com [libmcrypt-2.5.8]#

If I download this file to my local computer and FTP it to my server, what directory does it need to be placed in?
0
Zephyr ICTCloud ArchitectCommented:
You need to replace the name of the file ... you downloaded a file with a different name so you need to adjust your commands ...
tar zxvf freetds-0.91.112.tar.gz

Open in new window


Once it's unpacked you need to go into that folder, it will probably also have this new name.

Normally the file should be downloaded in the folder where you are when you execute the wget function...
0
mfinoccAuthor Commented:
First, I'd like to thank you for sticking with me on this; much appreciated!

Okay, made it past tar zxvf freetds-0.91.112.tar.gz and the following commands...

cd freetds-0.91/ #in my case
./configure --prefix=/usr/local/freetds --enable-msdblib
make
make install

Got stuck here...

cp include/tds.h /usr/local/freetds/include

Here's the message...

root@server.michaelfinocchio.com [libmcrypt-2.5.8]# cp include/tds.h /usr/local/freetds/include
cp: cannot stat `include/tds.h': No such file or directory
root@server.michaelfinocchio.com [libmcrypt-2.5.8]#

What next?
0
Zephyr ICTCloud ArchitectCommented:
That's the copy function so it might be you're not in the correct directory to perform the command ... Apparently you need to be in the freetds-091 directory (could be a little different maybe but you get the idea) ...

So go back to that directory and try the copy function again...
0
Dave BaldwinFixer of ProblemsCommented:
You're doing a lot of work to install something that may not work well for you.  The Freetds driver stopped at about SQL server 2005.  It does not support some of the newer datatypes in later versions.
http://www.freetds.org/userguide/tdshistory.htm
Note that the Freetds web site has not been updated since 2011.
0
Dave BaldwinFixer of ProblemsCommented:
You might check this out: https://www.microsoft.com/en-us/download/details.aspx?id=28160  It is a Linux version of Microsoft's SQL Native Client.
0
gheistCommented:
you can install php-mssql package that includes freetds in package and works with default php v5.3
0
Dave BaldwinFixer of ProblemsCommented:
'php-mssql' is not available in the standard repositories for CentOS 6.6.  You have to get it elsewhere... if it is available.
0
gheistCommented:
Yes, in EPEL
yum install epel-release
yum install php-mssql
apachectl graceful
<? phpinfo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobOwner (Aidellio)Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
0
gheistCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.