티스토리 뷰
기본적으로 리눅스 php 는 yum 설치시 mysql 까지만 지원한다.
아래를 보자
[root@test ~]# rpm -qa | grep php
php-soap-5.1.6-39.el5_8
php-pdo-5.1.6-39.el5_8
php-xml-5.1.6-39.el5_8
php-sqlite3-0.4-1.mf
php-mbstring-5.1.6-39.el5_8
php-mysql-5.1.6-39.el5_8
php-5.1.6-39.el5_8
php-imap-5.1.6-39.el5_8
php-devel-5.1.6-39.el5_8
php-common-5.1.6-39.el5_8
php-gd-5.1.6-39.el5_8
php-cli-5.1.6-39.el5_8
php-mcrypt-5.1.6-15.el5.centos.1
php-pear-1.4.9-8.el5
php-pear-DB-1.7.13-1.el5.centos
php + mssql 연동을 위해서는 우선, rpm 설치가 필요하다.
아래를 보자
[root@mil1 ~]# yum install php-mssql
--> Running transaction check
---> Package php-mssql.x86_64 0:5.1.6-15.el5.centos.1 set to be updated
--> Processing Dependency: libsybdb.so.5()(64bit) for package: php-mssql
--> Running transaction check
---> Package freetds.x86_64 0:0.91-2.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================
Installing:
php-mssql x86_64 5.1.6-15.el5.centos.1 extras 24 k
Installing for dependencies:
freetds x86_64 0.91-2.el5 epel 995 k
Transaction Summary
=============================================================================================================================================================================================================================================
Install 2 Package(s)
Upgrade 0 Package(s)
Total download size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-mssql-5.1.6-15.el5.centos.1.x86_64.rpm | 24 kB 00:00
(2/2): freetds-0.91-2.el5.x86_64.rpm | 995 kB 00:03
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 164 kB/s | 1.0 MB 00:06
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : freetds 1/2
Installing : php-mssql 2/2
Installed:
php-mssql.x86_64 0:5.1.6-15.el5.centos.1
Dependency Installed:
freetds.x86_64 0:0.91-2.el5
yum 설치 후,
php 에서는 아래와 같이 이용가능하다.
$hostname = "test.server.com";
$username = "testuser";
$password = "testpasswd";
$dbname = "TEST_DB";
// Connection
$msconn = MSSQL_CONNECT($hostname, $username, $password) or DIE("DB Failed to respond");
// Select DB
mssql_select_db($dbname, $msconn) or DIE("Table unavailable");
끗
'Computer > 웹' 카테고리의 다른 글
각 브라우저의 엔진 (0) | 2017.08.10 |
---|---|
( 스탯카운터 ) 2017 한국 인터넷 브라우저 점유율 (0) | 2017.08.10 |
(PHP) 5.2 이하 버전에서 JSON 이용하기 (0) | 2017.06.30 |
(PHP) 값이 숫자인지 판단 (1) | 2017.06.27 |
Javascript 로 html 태그에 class, id 추가하기 (2) | 2017.06.24 |
- Total
- Today
- Yesterday
- Node
- git hub
- mysql
- BBC 가쉽
- CentOS
- 앵커브리핑
- 안드로이드
- php
- node.js
- 깃헙
- nodejs
- Android
- Kotlin
- linux
- IOS
- 배열
- xcode
- C
- 리눅스
- 스위프트
- 손석희
- 뉴스룸
- Asterisk
- Swift
- 서버
- Phaser
- 점유율
- 노드
- C언어
- GIT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |