[Ubuntu] APM ์์ค ์ค์น(์๋ ์ค์น)ํ๊ธฐ - 3 (PHP)
๐ํ์ ํจํค์ง ์ค์น
๋จผ์ ํ์ํ ํจํค์ง๋ค์ ์ค์นํ๋ค.
& sudo su
/usr/local# apt-get install libxml2-dev
/usr/local# apt-get install libjpeg-dev
/usr/local# apt-get install libpng-dev
/usr/local# apt-get install libsqlite3-dev
๐์์ค์ค์น ํ์ผ ๋ค์ด๋ก๋ ๋ฐ ์์ถํด์
/usr/local# wget https://www.php.net/distributions/php-8.1.0.tar.gz
/usr/local# tar xvfz php-8.1.0.tar.gz
๐PHP ์ค์น (php-8.1.0)
/usr/local# cd php-8.1.0
/usr/local/php-8.1.0# ./configure \--with-apxs2=/usr/local/apache2.4/bin/apxs \--enable-mysqlnd \--with-mysql-sock=mysqlnd \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-imap-ssl \--with-iconv \--enable-gd \--with-jpeg \--with-libxml \--with-openssl

/usr/local/php-8.1.0# make
/usr/local/php-8.1.0# make test
/usr/local/php-8.1.0# make install

mysql์ฒ๋ผ make๋ถ๋ถ์์ ์๊ฐ์ด ์กฐ๊ธ ๊ฑธ๋ ธ๋ค!
make test์์ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ฌ๋ค!ใ ใ ์ฐพ์๋ณด๋๊น ๋ฌด์ํ๊ณ ํ๋ผ๋ ์๊ธฐ๋ ์์ด์ ๋ฌด์ํ๊ณ ์งํ
Phar: bug #69958: Segfault in Phar::convertToData on invalid file [ext/phar/tests/bug69958.phpt] (warn: XFAIL section but test passes)
๐Apache, PHP ์ฐ๋
1. ๋ชจ๋ ์ค์นํ์ธ
์ํ์น ์ค์ ํ์ผ์ธ httpd.conf ํ์ผ์ ์ด์ด PHP ๋ชจ๋์ด ์ค์น๋๋์ง ํ์ธํ๋ค.
/usr/local# cd apache2.4/conf
/usr/local/apache2.4/modules ์์ libphp.so๊ฐ ์๊น๋ ค์๋ค!

$ vi /usr/local/apache2.4/conf/httpd.conf


๋๊ฐ๋๋ escํค + :wq!
2. php.ini ํ์ผ ์ธํ
- production ์์คํ ์ฉ ์ค์ ํ์ผ์ธ php.ini-production ํ์ผ์ /usr/local/lib/php.ini์ ๋ณต์ฌํ๋ค.
- php configure ์์ ์ต์ ์ผ๋ก php.ini์ ์์น๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด ๊ธฐ๋ณธ์ผ๋ก /usr/local/lib/php.ini๋ฅผ ์ฌ์ฉํ๋ค.
- php.ini์ PHP์ค์ ํ์ผ์ธ๋ฐ php-8.1.0 ๋๋ ํ ๋ฆฌ๋ก ๊ฐ๋ฉด php.ini-development์ php.ini-production ๋๊ฐ์ ํ์ผ์ด ์๋ค. development๋ ๊ฐ๋ฐ์ฉ, production์ ํ๋ก๋์ ์์คํ ์ฉ ๋ฒ์ ์ผ๋ก ๊ฐ๋ฐ์ฉ ๊ฐ์ ๊ฒฝ์ฐ ๋ ๋ง์ ์ค๋ฅ์ ๊ฒฝ๊ณ ๋ฅผ ํ์ํด์ฃผ์ง๋ง ๋ณด์์ ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์์ผ๋ฏ๋ก ๊ฐ๋ฐ ํ๊ฒฝ์์๋ง ์ฌ์ฉํด์ผํ๋ค.
/usr/local# cd php-8.1.0
/usr/local/php-8.1.0# cp php.ini-production /usr/local/lib/php.ini

3. ํ ์คํธ์ฉ php ํ์ผ ์์ฑ
์ํ์น์ ์น ์ฝํ ์ธ (html, php ํ์ผ ๋ฑ)๋ htdocs ๋๋ ํ ๋ฆฌ์ ์์นํ๋ค.
$ cd /usr/local/apache2.4/htdocs
$ vi phpinfo.php
<? php
phpinfo();
?>



์ฌ๊ธฐ์ ์์ฒญ๋๊ฒ ํฌ๋ํฐ ์ค์๋ฅผ ํ๋ค.....<?php๋ ์ด์ด์ ๋ถ์ฌ์์จ์ผํจ! ใ ใ ์ด๊ฑฐ ๋์ด์ฐ๊ธฐ ํด์ ๊ณ์ ์ฒ์๋ถํฐ ํ๋๋ผ,, ์ง์ง ์๊ฐ์ ๋ง์ด ์์๋จน์๋ค..
๋จผ์ ์ํ์น๋ฅผ ์ฌ์คํ ์ํจ ํ http://127.0.1.1/phpinfo.php๋ก ์ ์ํ์ฌ ์ค์น ์ ๋ณด๊ฐ ์ถ๋ ฅ๋๋ฉด ์ฑ๊ณต!
/usr/local# apache2.4/bin/httpd -k start
/usr/local# ps -ef | grep httpd | grep -v grep
/usr/local# sudo netstat -anp | grep httpd
/usr/local# sudo curl http://127.0.0.1



๋ง์ฝ Apache httpd ์๋ฌ๊ฐ ๋ฐ์ํ๋ค๋ฉด

(AH00558: httpd: Could not reliably determine the server's fully....message
๋ณดํต ํด๋น ์๋ฌ๋ ์ํ์น ์๋ฒ๋ฅผ ์์ํ ๋ ์์ฃผ ๋ฐ์ํ๋ค.
httpd.con ํ์ผ์์ ServerName์ ์ค์ ํด์ฃผ๋ฉด ๊ฐ๋จํ ํด๊ฒฐ๋๋ค.
/usr/local# cd apache2.4/conf
/usr/local/apache2.4.conf# vi httpd.conf
/ServerName # ServerName ๋จ์ด ๊ฒ์ ํ ์ฃผ์์ ํ๊ณ ๋ด์ฉ์ ์์ ํ๋ค.
:wq
systemctl start httpd


์ฐธ๊ณ
https://yeni-days.tistory.com/8
[Ubuntu] Ubuntu-20.04์ APM ์์ค ์ค์น(์๋ ์ค์น)ํ๊ธฐ - 3 (PHP)
apache ์ค์น : https://yeni-days.tistory.com/2 mysql ์ค์น : https://yeni-days.tistory.com/7 ํ์ ํจํค์ง ์ค์น ๋จผ์ ํ์ํ ํจํค์ง๋ค์ ์ค์นํ๋ค. & sudo su /usr/local# apt-get install libxml2-dev /usr/..
yeni-days.tistory.com
https://salix97.tistory.com/142?category=837576
Ubuntu 18.04 + Apache 2.4.41 + PHP 7.4.1 ์๋์ค์นํ๊ธฐ
Ubuntu 18.04 OS ์์ Apache 2.4.41 ์ปดํ์ผ ์ค์น๋ฅผ ์๋ฃํ๋ค. * ์ฐ๋ถํฌ์ ์ํ์น์ MySQL ์ ์ค์นํ๋ ๋ฐฉ๋ฒ์ ์ด์ ๊ธ์ ์ฐธ๊ณ ์ด์ ๊ธ 1 : ์ฐ๋ถํฌ์ ์ํ์น ์๋์ค์น ํ๊ธฐ ์ด์ ๊ธ 2 : ์ฐ๋ถํฌ ์ํ์น ์๋ฒ
salix97.tistory.com