참고 문서 |
---|
이 게시물은 리눅스 서버 구축의 포스팅을 따라하면서 막힌 부분을 수정한 것입니다.
지금 보고 계시는 사이트의 서버도 동일한 방법으로 구축하였습니다. (32bit CentOS)
저는 이 분야에 관한 지식이 깊지 않으며, 정확하지 않은 내용이 있을 수 있습니다.
PHP 다운로드
PHP를 다운로드 받습니다.
저는 5.2.9 버전을 설치했습니다.
참고로 2010년 5월 11일 현재, 최근 버전의 Zend Optimizer (3.3.9) 에서는 버전 5.3 미만의 php를 지원하고 있습니다.
# yum install libxml2-devel openssl-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel gmp-devel mysql-devel ncurses-devel unixODBC-devel pspell-devel net-snmp-devel
# tar xvfz php-5.2.9.tar.gz
# mv php-5.2.9 /root/php
# cd /root/php
PHP 설치
웹 서버(Apache | Lighttpd | Ngnix), MySQL 설치가 다 완료된 후에 컴파일 합니다.
웹 서버를 Lighttpd 으로 설치한 경우 컴파일 설정을 다르게 해야 합니다.
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --enable-magic-quotes --disable-dmalloc --enable-bcmath --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-inline-optimization --enable-mbstring --enable-mbregex --enable-gd-native-ttf --enable-ftp --with-jpeg-dir --with-freetype-dir --with-curl --with-zlib --with-gd --with-ttf --with-iconv --disable-debug
# make && make install
Lighttpd 설치를 따라하셨다면 컴파일 옵션을 아래와 같이 입력해서 설치합니다.
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --enable-sockets --enable-magic-quotes --disable-dmalloc --enable-bcmath --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-inline-optimization --enable-mbstring --enable-mbregex --enable-gd-native-ttf --enable-ftp --with-jpeg-dir --with-freetype-dir --with-curl --with-zlib --with-gd --with-ttf --with-iconv --disable-debug --enable-fastcgi --enable-force-cgi-redirect
PHP 설정
post_max_size는 post되는 정보의 사이즈를 설정하는 것이고 upload_max_filesize 는 업로드 가능한 최고용량이라고 합니다.
# cp php.ini-dist /usr/local/php/lib/php.ini
# vi /usr/local/php/lib/php.iniregister_globals = Off
post_max_size = 200M
file_uploads = On
upload_tmp_dir = /tmp
upload_max_filesize = 200M
allow_url_fopen = Off
allow_url_include = Off
Apache 연동
설치한 php를 Apache의 모듈로 연결시켜 줍니다.
# vi /usr/local/apache/conf/httpd.conf
LoadModule php5_module modules/libphp5.so
DirectoryIndex index.html index.php
<IfModule mime_module>
AddType application/x-httpd-php .php
</ifModule>
기타..
MySQL > Apache | Lighttpd > PHP 순으로 설치를 권합니다.
댓글 0
번호 | 제목 | 날짜 | 조회 수 |
---|---|---|---|
21 | 간단하고 강력한 xe 보안 향상 | 2014.11.08 | 1874 |
20 | yum install latest redis | 2019.03.27 | 1682 |
19 | yum install php-apcu | 2019.03.12 | 1542 |
18 | certbot apache multiple domain | 2019.04.10 | 1416 |
17 | 웹 백업 (쉘 스크립트) | 2018.10.14 | 1194 |
16 | yum install mariadb [2] | 2018.10.10 | 1143 |
15 | munin 설치 | 2018.10.13 | 787 |
14 | mysql 백업 (shell script) | 2018.10.14 | 697 |
13 | yum install php 7.1 [6] | 2018.10.10 | 687 |
12 | mysqldump from remote db to my local server. | 2023.05.04 | 421 |
11 | apache2 AllowOverride config | 2023.05.23 | 338 |
10 | gearman 은 무엇인가? | 2023.06.21 | 331 |
9 | php 에서 비동기 처리하는 방법 | 2023.06.22 | 325 |
8 | windows hardware encrypt ssd | 2024.01.23 | 250 |
7 | The best configuration of php7.4-fpm / 1.5GB | 2023.05.04 | 29 |
6 | The best configuration of php7.4-fpm / 8GB | 2023.05.04 | 23 |
5 | To download large files with rsync command. | 2023.05.04 | 21 |
4 | my.cnf | 2019.04.11 | 1 |
3 | net::ERR_CONNECTION_REFUSED | 2021.10.11 | 0 |
2 | php-fpm tcp to socket | 2020.01.25 | 0 |