Notice»

Recent Post»

Recent Comment»

Recent Trackback»

Archive»

« 2025/5 »
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
05-11 02:50

 
 

일반적인 PHP에러모음

programming/PHP | 2014. 1. 10. 20:57 | Posted by Work Ant

오류 메세지 : configure: error: xml2-config not found. Please check your libxml2 installation 
해결 방법 : yum install libxml2 libxml2-devel -y 

오류 메세지 : configure: error: Please reinstall the BZip2 distribution 
해결 방법 : yum -y install bzip2-devel 

오류 메세지 : configure: error: libjpeg.(a|so) not found. 
해결 방법 : yum -y install libjpeg-devel 

오류 메세지 : configure: error: libpng.(a|so) not found. 
해결 방법 : yum -y install libpng-devel 

오류 메세지 : configure: error: freetype.h not found. 
해결 방법 : yum -y install freetype-devel 

오류 메세지 : configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information. 
해결 방법 : yum -y install libc-client-devel 

오류 메세지 : configure: error: Kerberos libraries not found. 
해결 방법 : yum -y install krb5-devel 

오류 메세지 : configure: error:Cannot find OpenSSL's <evp.h> 
해결 방법 : yum -y install openssl-devel


checking for termcap functions library... configure: error: No curses/termcap library found
해결책 :  # yum -y install ncurses-devel

configure: error: C++ preprocessor "/lib/cpp" fails sanity check
해결책 : # yum -y install gcc-c++

/usr/lib/libdb-4.3.so: could not read symbols: File in wrong format
/usr/lib/libexpat.so: could not read symbols: File in wrong format

해결책 : # mv /usr/lib/libexpat.so /usr/lib/libexpat.so.bak
               # ln -s /lib64/libexpat.so.0.5.0 /usr/lib/libexpat.so  
               # mv /usr/lib/libdb-4.3.so /usr/lib/libdb-4.3.so.bak
               # ln -s /lib64/libdb-4.3.so /usr/lib/libdb-4.3.so 
에러의 원인은 64비트 환경에서 32비트용 소스를 가져다가 설치하기 때문이다. 컴파일 도구와 관련된 심볼릭 링크 파일을 찾지 못한다고 나오고 있다. 

configure: error: Unable to locate gmp.h
해결책 : # yum -y install gmp*

configure: error: not found. Please reinstall the expat distribution.
해결책 : # yum -y install expat*

configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/
해결책 : # yum -y install curl* 또는 yum -y install curl & yum -y install curl-devel

configure: error: Please reinstall libmcrypt - I cannot find mcrypt.h <br>
configure: error: Please reinstall libmhash - I cannot find mhash.h
해결책 : # yum install libmcrypt libmcrypt-devel libmhash libmhash-devel

Configure: error: xml2-config not found. Please check your libxml2 installation
해결책 : #yum install libxml2-devel

Checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
해결책 : #yum install openssl-devel

Configure: error: Please reinstall the BZip2 distribution
해결책 : # yum install bzip2-devel

Configure: error: libjpeg.(also) not found.
해결책 : # yum install libjpeg-devel

Configure: error: libpng.(also) not found.
해결책 : yum install libpng-devel

Configure: error: freetype.h not found.
해결책 : #yum install freetype-devel

Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
해결책 : # yum install mysql-devel

Configure: error: Please reinstall the ncurses distribution
해결책 : # yum install ncurses-devel

Checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!
해결책 : # yum install unixODBC-devel

Configure: error: Cannot find pspell
해결책 : # yum install pspell-devel

Configure: error: snmp.h not found. Check your SNMP installation.
# yum install net-snmp-devel

configure: error: ZLIB extension requires zlib >= 1.0.9

ln -sf /usr/lib64/libgssapi_krb5.so.2.2 /usr/lib/libgssapi_krb5.so
ln -sf /usr/lib64/libkrb5.so.3.3 /usr/lib/libkrb5.so
ln -sf /usr/lib64/libk5crypto.so.3.1 /usr/lib/libk5crypto.so
ln -sf /lib64/libcom_err.so.2 /usr/lib/libcom_err.so
ln -sf /usr/lib64/libgcrypt.so.11 /usr/lib/libgcrypt.so
ln -sf /usr/lib64/libgpg-error.so.0 /usr/lib/libgpg-error.so
ln -sf /usr/lib64/libexpat.so /usr/lib/libexpat.so
ln -sf /usr/lib64/libm.so /usr/lib/libm.so
ln -sf /usr/lib64/libssl.so /usr/lib/libssl.so

64bit os에서 php 5.2.6 configure 옵션에 --with-kerberos 옵션 넣어서 configure 진행했을경우 에러 나는 경우 조치 사항

krb5-devel 관련 라이브러리 파일을 /usr/lib64 에서 /usr/lib로 복사 링크

/usr/lib64/libdes425.a
/usr/lib64/libdes425.so
/usr/lib64/libgssapi_krb5.a
/usr/lib64/libgssapi_krb5.so
/usr/lib64/libgssrpc.a
/usr/lib64/libgssrpc.so
/usr/lib64/libk5crypto.a
/usr/lib64/libk5crypto.so
/usr/lib64/libkadm5clnt.a
/usr/lib64/libkadm5clnt.so
/usr/lib64/libkadm5srv.a
/usr/lib64/libkadm5srv.so
/usr/lib64/libkdb5.a
/usr/lib64/libkdb5.so
/usr/lib64/libkrb4.a
/usr/lib64/libkrb4.so
/usr/lib64/libkrb5.a
/usr/lib64/libkrb5.so


출처 : http://www.nicesolo.com/entry/php-%EC%97%90%EB%9F%AC

 

:

php 함수 file_exists

programming/PHP | 2014. 1. 10. 20:57 | Posted by Work Ant

특정경로에 파일 또는 디렉토리가 있는지 없는지 검사하는 함수


<?php

$filepath = '/img/11111.jpg';


if(file_exists($filepath)){

echo "존재함";

}

else{

echo "없음";

}

?>

:

<?php


echo gethostname();


?>

'programming > PHP' 카테고리의 다른 글

일반적인 PHP에러모음  (0) 2014.01.10
php 함수 file_exists  (0) 2014.01.10
FreeTDS 설치 (PHP와 MS-SQL 연동)  (1) 2014.01.10
:

FreeTDS 설치 (PHP와 MS-SQL 연동)

programming/PHP | 2014. 1. 10. 13:15 | Posted by Work Ant

FreeTDS 설치 (PHP와 MS-SQL 연동)


 

Apache + PHP 사용시 원격 MSSQL 데이터베이스에 접근 하는 방법중 FreeTDS를 이용한 방법이 있습니다.
설치법도 간단하고 간단한 설정법으로 한글깨짐현상도 해결할 수 있습니다.


[설치]
/usr/local/src#
 wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz

/usr/local/src# tar xvfpz freetds-stable.tgz

/usr/local/src/freetds# ./configure 
--prefix=/usr/local/freetds 
--with-tdsver=8.0 
--disable-odbc 
--disable-debug 
--enable-dbmfix 
--enable-msdblib

/usr/local/src/freetds# make

/usr/local/src/freetds#
 make install


[참고]

mssql 2005 의 경우 --with-tdsver=8.0

mssql 2000 의 경우 --with-tdsver=8.0

mssql 7.0 의 경우 --with-tdsver=7.0

mssql 6.0 의 경우 --with-tdsver=4.2

 

configure 단계에서 'Directory /usr/local/freetds is not a FreeTDS installation directory' 라는 메시지가 나올경우
# cp /usr/local/src/freetds/include/tds.h /usr/local/freetds/include/
또는
# cp /usr/local/src/freetds/src/tds/.libs/tds.h /usr/local/freetds/include/
tds.h 파일을 설치된 디렉토리에 복사한다. 

 


[설치 계속]

freetds.conf 파일에 client charset=EUC-KR을 추가하여 한글깨짐 현상을 막을 수 있습니다..
( /usr/local/freetds/etc/freetds.conf ) 

 

[global]<br />client charset = EUC-KR<br />



PHP 설치

/usr/local/src/php# ./configure 
--prefix=/usr/local/php 
--with-apxs2=/usr/local/bin/apxs
--with-sybase=/usr/local/freetds
--with-mssql=/usr/local/freetds    <- 하단 참고사항 확인


/usr/local/src/php# make
/usr/local/src/php# make install

[참고] php 5.X --with-mssql 오류시 해결 방안  

php 5.X에서 mssql연동을 위해 freetds를 설치할 경우에  php configure에 --with-mssql=/usr/local/freetds로 주었을때 해당 경로에 설치가 되어있음에도 불구하고 해당 경로에 설치가 되어있지 않다고 나오는 경우가 발생합니다.

에러 메세지
error Directory /usr/local/freetds is not a FreeTDS installation directory

해당 문제는 tds.h, libtds.a가 해당 설치경로에 있지 않아 설치되어 있는데도 설치되어 있지 않은것으로 인식되는 문제로 보입니다.

아래와 같이 해당 파일들을 경로로 복사해 주면 문제가 해결 됩니다.

cp /usr/local/src/freetds-xxx/include/tds.h /usr/local/freetds/include
cp /usr/local/src/freetds-xxx/src/tds/.libs/libtds.a /usr/local/freetds/lib

위와 같이 한 후에 make 과정중에 sysbase 오류가 발생한다면 configure 시에 --with-mssql과 --with-sybase를 같이 넣어 줍니다.


[참고 - PHP와 MS-SQL연동을 위해 odbc를 이용한 방법 - 오래된메뉴얼]
http://cafe.naver.com/webmas.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=1000

 

 

[출처] 정상을 위한 독주2 (http://blueb.net/blog/1321) | 블루비

[추가/수정] 차동훈 (http://system.neulwon.com)

 

--------------------------------------------------------------------------------------

 

php - mssql 연동 테스트 소스

 

<?

$connection=mssql_connect("MyServer","msconn","msconn");
print ("db open");
mssql_connect($connection);
print ("db close");
$status = mssql_select_db("master",$connection);

if (!$status) {
$errNO = mssql_errno($connection);
$errMSG = mssql_errno($connection);

echo("데이터 베이스 연결 실패");
echo("에러메세지 $errNO : $errMSG");
exit;
}


$que = mssql_query("select * from sysfiles");
$row = mssql_fetch_row($que);

echo"

$row[0] $row[1] $row[2]";

echo"
성공";
?>

[발췌] Nugi's World | 야서누기 (http://blog.daum.net/evasuri/10243883)

'programming > PHP' 카테고리의 다른 글

일반적인 PHP에러모음  (0) 2014.01.10
php 함수 file_exists  (0) 2014.01.10
php 함수 gethostname() 로컬서버호스트 이름 가져오기  (0) 2014.01.10
: