APM 설치(Apache, PHP, MySQL) - PHP

동스토리 ㅣ 2020. 8. 6. 10:15

반응형

CenOS7 APM 설치 매뉴얼

버전: Cent7, mysql5.7, Apache 2.2, PHP5.6, boost1.59


1) php 소스파일 다운로드

 

wget http://kr1.php.net/distributions/php-5.6.17.tar.gz

tar xvfz php-5.6.17.tar.gz

2) 필수 패키지 설치

 

yum install -y libxml2-devel libcurl-devel gd-devel libmcrypt-devel

3) php 소스 컴파일 및 설치 (configure & make, make install)

 

'./configure' '--prefix=/usr/local/php' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-pdo-mysql=/usr/local/mysql' '--disable-debug' '--enable-fpm' '--enable-sigchild' '--enable-inline-optimization' '--enable-sysvsem' '--enable-sysvshm' '--enable-bcmath' '--enable-ftp' '--enable-sockets' '--enable-exif' '--enable-soap' '--with-zlib-dir=/usr' '--with-zlib' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr' '--with-iconv' '--enable-mbstring' '--with-curl' '--with-openssl' '--enable-zip' "$@"

 

정상적인  config 가 완료되면 위와 같은 상태창을 볼 수 있다.

정상적인 config make –j 8; make install 을 통해 설치를 완료한다.

4) 테스트

 

http://localhost/Phpinfo.php  /user/local/apache/htdocs/phpinfo.php

<?php phpinfo(); ?>

를 통한 테스트시 php 정보가아닌 순수 문자만 나올경우 (그 외도 동일 연동오류)

Vi /etc/php.ini

short_open_tag = On

/etc/init.d/httpd restart 후 확인

 

* php & mysql 연동 확인

 

<!DOCTYPE html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

  <title>MySql-PHP 연결 테스트</title>

</head>

<body>

 

<?php

echo "MySql 연결 테스트<br>";

 

$db = mysqli_connect("localhost", "root");

 

if($db){

    echo "connect : 성공<br>";

}

else{

    echo "disconnect : 실패<br>";

}

 

$result = mysqli_query($db, 'SELECT VERSION() as VERSION');

$data = mysqli_fetch_assoc($result);

echo $data['VERSION'];

?>

 

</body>

</html>

 

감사합니다.

 

 

 

반응형

'Security > System' 카테고리의 다른 글

i-node  (0) 2020.11.09
APM 설치(Apache, PHP, MySQL) - MySQL  (0) 2020.08.06
APM 설치(Apache, PHP, MySQL) - Apache  (0) 2020.08.06
MySQL 설치  (0) 2020.07.28
이클립스(Eclipse IDE for Java EE Developers) 설치  (0) 2020.07.28