기본 콘텐츠로 건너뛰기

php 개발 설치 아파치

1. Apache 설치

보통 기본적으로 설치되어 있습니다

yum install httpd

2. php 설치

php와 관련 모듈을 설치합니다.

yum install php php-devel php-pear php-mysql php-mbstring php-gd php-imap php-odbc php-xmlrpc php-xml


3. php 설정 변경

기본적인 설정을 아래와 같이 변경해 줍니다.

cd /etc
cp -p php.ini php.ini_orgn
vi php.ini


short_open_tag = On
allow_call_time_pass_reference = On
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_DEPRECATED
display_errors = On
display_startup_errors = On
register_globals = On
register_long_arrays = Off
magic_quotes_gpc = On
magic_quotes_runtime = Off
date.timezone = "Asia/Seoul"


4. Apache에 php 연동

@ /etc/httpd/conf/httpd.conf

LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php .php3 .php4 .php5 .html .htm .inc
DirectoryIndex index.html index.htm index.php

5. 테스트 페이지 생성

DocRoot 경로에 아래와 같이 test.php 파일 생성

test.php




6. Apache 기동 및 테스트 페이지 호출

/etc/init.d/httpd start

7. cgi 연동
sudo chkconfig httpd on
sudo yum install php-cgi

Apache Configuration Block
:::php-cgi.conf  위치 /etc/httpd/conf.d/   or  conf.d
ScriptAlias /local-bin /usr/bin
AddHandler application/x-httpd-php5 php
Action application/x-httpd-php5 /local-bin/php-cgi

/etc/php.ini
error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = Off
log_errors = On
error_log = /var/log/php.log
max_execution_time = 300
memory_limit = 64M
register_globals = Off


댓글

이 블로그의 인기 게시물

UltraEdit Professional Version 18.20.0.1014 라이센스 키 넣기

Step 1: unpack rar archive      Step 2: run the setup   Step 3: Use the given keygen to activate    Add the line   127.0.0.1 licensing.ultraedit.com         to your %WINDOWS%\system32\drivers\etc\hosts file                 Enter any data for license-id and password (license-id must be a         number)                 Choose Offline activation and generate corresponding activation         codes for your user codes   Step 4: Enjoy and Support Developers, Buy It, They Deserved It!

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"