본문 바로가기

카테고리 없음

php 빌드 도전기

로컬에 설치되어 있는 virtualbox-centos에 PHP를 빌드하고자 한다. 

우선 PHP-Src를 클론하고, 

~> git clone https://github.com/php/php-src.git
~> cd php-src
# by default you will be on the master branch, which is the current
# development version. You can check out a stable branch instead:
~/php-src> git checkout PHP-8.1

~/php-src> yum install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel
#처움에 난 7줄의 명령어를 모르고  yum list installed  |grep 명령어로 있는 걸 제외한 re2c만 rpm으로 설치했는데, ./configure과정에서
#오류가 났었다.  내꺼에 설치된건 libxml2-devel이 아니라 libxml2만 있어서 버전 문제로 시간만 지체되었다.

~/php-src> ./buildconf     # only necessary if building from git
~/php-src> ./configure
~/php-src> make -jN
~/php-src> make install  # 이건 좀 오래걸림

밥 먹고 오면 된다.

/usr/local에 잘 설치되었다.

참고

Building PHP — PHP Internals Book

php/php-src: The PHP Interpreter (github.com)

centos7 - How to Install re2c on Linux Centos 7 - Stack Overflow