블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

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

Notice

2014. 6. 24. 17:04 Scripts


php5.3 부터는 session_register()와 session_unregister()가 사용되질 않는다.


session_register('ID',$ID);

> $_SESSION['ID']=$ID;


session_unregister("ID");

> unset($_SESSION['ID']);



반응형
posted by Rootrator
2014. 5. 27. 15:34 Linux

php 컴파일시에 


Note that the MySQL client library is not bundled anymore!


위와 같은 에러가 뜨는 경우가 있는데,


apache를 컴파일 할때 --with-mpm-worker로 옵션을 줄 경우 


아파치는 Thread로 처리를 하지만 mysql은 컴파일 할 때 Thread-safe 옵션을 주지 않아서


libmysqlclient_r이 생성되지 않았기 때문이다.


prefork방식으로 처리시에는 에러가 뜨지 않는다.


mysql 컴파일시에 --enable-thread-safe-client 옵션을 추가한다.



또는 mysql을 설치하지 않았거나, rpm으로 설치 했을때


[root@localhost ~]# yum install -y mysql-devel


명령어로도 생성이 된다.

반응형
posted by Rootrator
2014. 3. 10. 11:15 Linux

Warning: session_start(): Cannot send session cache limiter - headers already sent

위 에러는 PHP 세션 관련해서 생기는 오류인데 해결법에 대해 써보도록 하겠다.

첫번째는 session_start() 구문을 주석처리 해버리는것..

오류는 뜨지 않겠지만 일부 기능이 제대로 작동하지 않을수 있다.


두번째는 session_start() 구문을 PHP코드의 제일 상단에 위치할것.
 
구문 앞에 공백이 존재하면 안된다.


세번째는 소스파일을 저장시 UTF-8 BOM 없음 선택하고 저장해야 한다.

UTF-8 헤더가 추가되어 있을 경우에 위 에러가 뜨기 때문


네번째는 php.ini에서 output_buffering=On으로 변경하고 아파치 재시작한다.


반응형

'Linux' 카테고리의 다른 글

CentOS 4.x yum 실행시 에러  (0) 2014.03.24
php 컴파일 에러 /usr/bin/ld: cannot find -lltdl  (0) 2014.03.13
압축된 백업파일에서 특정 디렉토리만 풀기  (0) 2014.02.25
Linux 시간 설정하기  (0) 2014.02.06
PHP 5.3 사용  (0) 2013.10.01
posted by Rootrator
2013. 10. 1. 15:02 Linux

PHP 5.3 버전을 설치 후 셋팅


5.3 버전부터는 Timezone 셋팅을 해줘야 한다. 셋팅해주지 않으면 아래 오류가 뜸


PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Seoul' for 'KST/9.0/no DST' instead in Command line code on line 1



php.ini의 [date] 섹션에 아래를 추가

date.timezone="Asia/Seoul"


그럼 이제 phpinfo를 확인을 위해 httpd.conf에 아래줄을 추가


    AddType  application/x-httpd-php  .php  .php3

    AddType  application/x-httpd-php-source  .phps


그럼 이제 phpinfo로 확인해 보려 했지만 소스가 먹지 않는다.

<?

phpinfo();

?>



위 축약식은 short_open_tag가 on이 되어 있어야 하는데 기본설정으로 Off가 되어 있어서 그렇다.


php.ini에서


short_open_tag=On


변경 후에 정상적으로 확인이 가능하다.


5.2버전까지만 해도 잘 사용했던 ZendOptimizer가 ZendGuardLoader로 변경되었지만


설치하는데는 별 문제가 없다.


홈페이지에서 다운후(로그인 필요) 해제후 so파일을 적당한 위치에 넣고 zend_extension으로 지정해 주면 된다.


[root@dev ~]# php -v

PHP 5.3.8 (cli) (built: Oct  1 2013 13:15:07)

Copyright (c) 1997-2011 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies



반응형

'Linux' 카테고리의 다른 글

압축된 백업파일에서 특정 디렉토리만 풀기  (0) 2014.02.25
Linux 시간 설정하기  (0) 2014.02.06
soap사용하기  (0) 2013.08.27
아파치/mysql EUC_KR에서 UTF-8 사용하기  (0) 2013.08.13
2차 네임서버 업데이트설정  (0) 2013.03.29
posted by Rootrator
2013. 6. 19. 09:53 Scripts



Warning: imagepng()  [function.imagepng]: gd-png: fatal libpng error: zlib error in 파일명 on line XX





PHP4에서 사용하던 소스를 PHP5에서 운용하다보니 위와 같은 에러 발생


libpng나 gd 등 재설치도 소용이 없었는데.. 문제는 버전차이로 인한 변경점



imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $qulity);


제일 마지막 함수인데 PHP4에선 압축률을 0 - 100까지 지정할수 있으나 


PHP5에선 0 - 9로 변경되었다.


imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], 9);


위와같이 변경하니 에러가 사라짐..

반응형
posted by Rootrator
prev 1 next