mysql 5.2.10 설치중 PEAR문제

리눅스/PHP|2015. 1. 16. 10:29
반응형

5.2.10 을 깔면은 대체적으로 비슷한 사람들에게 =_= 대부분 문제가 생기는거 같다.
이거 생각외로 꽤 Critical 한 문제인데 왜 대책을 안세우는지 이해가 안가는... 
결론부터 이이야기하자면은,  별거 -_- 아닌거 가지고 잘못 빌드한거 같은데.. ;; 암튼 간단하게 해결 가능하다

1. 증세
 - make test를 반드시 해보자 
 - php 컴파일할때 대부분 귀찮아서 안하는데,  시간이 튀어서 하는게 아니다.  에러가 난다고 하면은 분명 뭔가가 이상이 있다는거다. 
Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1391

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1396

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1400

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1391

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1396

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1400

Warning: Cannot use a scalar value as an array in phar://install-pear-nozlib.phar/PEAR/ChannelFile.php on line 1391 

뭔가 위에 메시지하고 비슷한 에러메시지가 보일거다. 

2. 해결 방법 
http://www.pear-forum.org/post-5065.html
맨 아래 보면은 '님들아 저 해결했어요 ;ㅁ;'라고 적혀 있어서 찾아보니깐 정말 되더라는...

php설치된 디렉토리에 하부 .channels 라는 디렉토리가 있는데 이 내용만 다 지워주면 끗.


[출처] Gallery-하나둘셋넷...너에게로 | Bani (http://lunne.egloos.com/1943059)

반응형

댓글()

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

리눅스/PHP|2015. 1. 16. 10:29
반응형

PHP5 설치시 아래와 같은 에러메세지가 나온다면 설치에 필요한 구성요소를 미리 설치하면 됩니다.

 

[증상]

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 libc-client-devel


안될경우 아래와 같이 수동 설치



[
libc-client-devel설치]

# cd/usr/local/src

wget https://www.mirrorservice.org/sites/ftp.cac.washington.edu/imap/imap-2007f.tar.gz

# tar xvzf imap-2007f.tar.gz

# cd imap-2007f

# yum -y install pam-devel

make lr5 PASSWDTYPE=std SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC IP=4

# mkdir /usr/local/imap-2007f/

# mkdir /usr/local/imap-2007f/include/

# mkdir /usr/local/imap-2007f/lib/

# cp c-client/*.h /usr/local/imap-2007f/include/

# cp c-client/*.c /usr/local/imap-2007f/lib/

# cp c-client/c-client.a /usr/local/imap-2007f/lib/libc-client.a



* php 컴파일중 

에러 : configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

해결 : imap-2007f 설치 후 --with-imap=/usr/local/imap-2007f 옵션을 사용합니다.



반응형

댓글()

php 컴파일시 Cannot find libmysqlclient_r 오류 발생처리

리눅스/PHP|2015. 1. 16. 10:28
반응형

작업환경)
* Pentium 820D / 1G / 250G / RHEL 4-2.6.20.7
* mysql 5.0.41 confugure 설정
./configure --prefix=/usr/local/mysql --with-charset=euckr
* apache 2.2.4 configure 설정
 ./configure --prefix=/usr/local/httpd2 --enable-mods-shared=most --enable-module=so --with-mpm=worker
* php 5.2.2 configure 설정
./configure --with-apxs2=/usr/local/httpd2/bin/apxs --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/httpd2/conf --with-exec-dir=/usr/local/httpd2/bin --enable-track-vars --enable-trans-sid
* 컴파일 순서 : mysql -> apache -> php
------------------------------------------------
mysql과 apache는 올바르게 컴파일되어 서비스가 제공 되었으나 php 컴파일이 올바르게 되지 않았습니다.
(중략)
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql
Note that the MySQL client library is not bundled anymore!

[root@client2 mysql]# pwd
/usr/local/mysql/lib/mysql

[root@client2 mysql]# ls
libdbug.a    libmyisammrg.a    libmysqlclient.so.15    libmysys.a    libheap.a    
libmysqlclient.a    libmysqlclient.so.15.0.0    libvio.a    libmyisam.a  libmysqlclient.la  
libmysqlclient_r.so  libmysqlclient.so    libmystrings.a

원인)
libmysqlclient_r 이 mysql을 컴파일 할 때 생성되지 않아서 생기는 문제입니다.
Apache 가 Thread 모드로 설치되어있으나, MySQL 은 Thread Safe 옵션을 주지 않았기 때문입니다.
맨 처음 Apache 를 컴파일 할 때 --with-mpm=worker 옵션으로 MPM 방식을 Worker 로 지정하였습니다. Worker 방식의 경우 Thread 단위로 요청을 처리하지만 mysql 은 Thread 처리를 하도록 컴파일 되지 않았기 때문에 PHP 컴파일을 하면서 오류가 발생한 것입니다. 물론 Apache 컴파일시 prefork (기본값)으로 설치시에는 이런 문제가 발생하지 않습니다.

해결방안)
mysql 컴파일 시 다음 옵션을 추가해 봅니다.
--enable-thread-safe-client

# ./configure --prefix=/usr/local/mysql --with-charset=euckr --enable-thread-safe-client && make &&make install

[root@client2 mysql]# pwd
/usr/local/mysql/lib/mysql

[root@client2 mysql]# ls
libdbug.a    libmyisammrg.a     libmysqlclient_r.a   libmysqlclient_r.so.15      libmysqlclient.so.15      libmysys.a
libheap.a    libmysqlclient.a   libmysqlclient_r.la  libmysqlclient_r.so.15.0.0  libmysqlclient.so.15.0.0  libvio.a
libmyisam.a  libmysqlclient.la  libmysqlclient_r.so  libmysqlclient.so           libmystrings.a

mysql library 디렉토리에 libmysqlclient_r  가 올바르게 생성되었습니다. 

이제 php를 다시 컴파일 하면 됩니다.

 

[출처] 그런즉 선 줄로 생각하는 자는 넘어질까 조심하라 | 아스라다 (http://blog.naver.com/01191879872?Redirect=Log&logNo=10017203362)

반응형

댓글()

Warning: main(): URL file-access is disabled in the server

리눅스/PHP|2015. 1. 16. 10:28
반응형

php.ini 파일을 열어 아래와 같이 변경 해주고, httpd 를 재시작 해줍니다.

 

allow_url_fopen = On        // 기본값 Off

반응형

댓글()

/usr/lib/libltdl.so: could not read symbols: File in wrong format

리눅스/PHP|2015. 1. 16. 10:27
반응형

php 4.3.10, php 5.2.9 에서 오류 확인


[make 오류]

/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libc-client.so when searching for -lc-client
/usr/bin/ld: skipping incompatible /usr/lib/libc-client.a when searching for -lc-client
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/lib/libltdl.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [libphp5.la] 오류 1

 

[조치]

ln -sf /usr/lib64/libltdl.so /usr/lib/libltdl.so  

create symbolic link `/usr/lib/libltdl.so' to `/usr/lib64/libltdl.so'

이후 make clean, make 실행

반응형

댓글()

php-json 설치

리눅스/PHP|2015. 1. 16. 10:27
반응형

압축을 풀어야 합니다.
root계정으로 들어가서 압축을 풀었습니다.
# tar -jxvf php-json-ext-1.2.1.tar.bz2

쓰여진 대로 설치합니다.
./configure
make 
make install


* configure시 php-config가 없다고 하는 경우가 있습니다. 이럴경우 아래처럼 옵션을 추가합니다.
./configure --with-php-config=/usr/local/php/bin/php-config

extension=json.so 를 php.ini / php.d에 설정해주라고 하는데 어떻게 하는건지?

간단한 예제 작성
<?
$val = array("abc" => 12,
             "foo" => "bar",
             "bool0" => false,
             "bool1" => true,
             "arr" => array(1, 2, 3, null, 5),
             "float" => 1.2345
            );
$output = json_encode($val);
echo $output."n";

?>
~


작동 안되면
Unable to load dynamic library './json.so'

json.so 를 /usr/local/lib 로 가져다 넣습니다.
php.ini에 
; Directory in which the loadable extensions (modules) reside.
extension_dir = "./"
extension_dir = "/usr/local/php/lib/php/extensions"
extension=json.so 를 셋팅해 줍니다.

정상적인 결과:
php json.php 
{"abc":12,"foo":"bar","bool0":false,"bool1":true,"arr":[1,2,3,null,5],"float":1.2345}

 

 

 [출처] 곰팅이의 열정과 신념 (http://jacking.x-y.net/entry/php-json-%EC%84%A4%EC%B9%98)

반응형

댓글()

php 확장모듈 설치하기

리눅스/PHP|2015. 1. 16. 10:27
반응형

1. 같은 버젼의 php 소스 다운로드 또는 원소스가 있다면 소스디렉토리로 이동 

2. 압축 풀고 # cd php소스디렉토리/ext/설치하고자하는확장모듈명 

3. /usr/local/php/bin/phpize

 

4. ./configure --with-php-config=/usr/local/php/bin/php-config --enable-설치하고자하는확장모듈명 

5. make => modules/설치하고자하는확장모듈명.so 라는 화일이 생성됨 

6. 설치하고자하는확장모듈명.so 이 화일을 php.ini 화일의 extension_dir=확장모듈 경로 에 옮겨줌 

7. php.ini 에 extension=확장모듈명.so 추가 

8. 아파치 재시작

 

 

[출처] 서버운영 | 김병국 (http://onlybible.tistory.com/1721)

반응형

댓글()

make: *** [libphp5.la] 오류 1

리눅스/PHP|2015. 1. 16. 10:26
반응형

5.2.9 (확인된 버전) 이하에서는 이런 오류 사항이 없습니다.
64bit에서만 나타나는 현상으로 보입니다.

<오류 메세지>

/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libc-client.so when searching for -lc-client
/usr/bin/ld: skipping incompatible /usr/lib/libc-client.a when searching for -lc-client
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.so when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/libcrypt.a when searching for -lcrypt
/usr/bin/ld: skipping incompatible /usr/lib/librt.so when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/lib/libltdl.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [libphp5.la] 오류 1

 

<해결방법>
make 전 다음 명령을 실행해줍니다. 

# ln -sf /usr/lib64/libltdl.so /usr/lib/libltdl.so  
create symbolic link `/usr/lib/libltdl.so' to `/usr/lib64/libltdl.so'

(스펠링 주의)

 

 

[출처] seroot.com (http://www.seroot.com/neosky?page=7)

반응형

'리눅스 > PHP' 카테고리의 다른 글

php-json 설치  (0) 2015.01.16
php 확장모듈 설치하기  (0) 2015.01.16
웹사이트에서 php 관련 error 메세지 안보기  (0) 2015.01.16
로그인 세션 유지시간 설정  (0) 2015.01.16
쉘에서 php 실행하기  (0) 2015.01.16

댓글()

웹사이트에서 php 관련 error 메세지 안보기

리눅스/PHP|2015. 1. 16. 10:26
반응형

php.ini 파일을 수정하여 아래와 같이 설정합니다.

 

display_errors = Off

반응형

'리눅스 > PHP' 카테고리의 다른 글

php 확장모듈 설치하기  (0) 2015.01.16
make: *** [libphp5.la] 오류 1  (0) 2015.01.16
로그인 세션 유지시간 설정  (0) 2015.01.16
쉘에서 php 실행하기  (0) 2015.01.16
PHP설치 오류 리스트  (0) 2015.01.16

댓글()

로그인 세션 유지시간 설정

리눅스/PHP|2015. 1. 16. 10:26
반응형

1분동안 암것도 하지 않았을 경우 종료라면...서버에 php.ini 파일을 수정해주셔도 됩니다.

session.cookie_lifetime = 0
session.gc_maxlifetime = 1440

위쪽 것은 세션 쿠키가 작동하는 시간을 초단위로 적는 것이고...0 이면 브라우저가 꺼지면 삭제됩니다.
아래 것이 사용자가 아무 작업도 하지 않았을 경우 1440초 후에 세션이 죽습니다.

 

[발췌] 지식인 (http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040203&docId=65001223&qb=c2Vzc2lvbi5nY19tYXhsaWZldGltZSBzZXNzaW9uLmNvb2tpZV9saWZldGltZQ==&enc=utf8&section=kin&rank=2&sort=0&spq=0&pid=f0/KvB331xwsssSWk8Vssv--486808&sid=S0-KK6CiT0sAACGgFos)

반응형

댓글()

쉘에서 php 실행하기

리눅스/PHP|2015. 1. 16. 10:25
반응형

1. 서버에 lynx 이 설치 되어있어야 합니다.

    설치가 안되어 있다면 설치를 합니다.

    # yum install lynx

 

2. 쉘에서 php 실행방법

    # lynx http://sysdocu.tistory.com/file.php -dump

 

3. 5분마다 실행 (crontab)

    */5 * * * * lynx http://sysdocu.tistory.com/file.php -dump

반응형

댓글()