>  기사  >  백엔드 개발  >  PHP5를 설치하는 방법

PHP5를 설치하는 방법

藏色散人
藏色散人원래의
2021-03-17 10:24:192158검색

php5 설치 방법: 먼저 PHP5 소스 코드 패키지를 다운로드한 다음 "make && make install" 명령을 통해 파일을 복사하여 구성 파일을 확인합니다.

PHP5를 설치하는 방법

이 기사의 운영 환경: Windows 7 시스템, PHP5 버전, DELL G3 컴퓨터

PHP5 설치

src 디렉터리로 이동 cd /usr/local/src

PHP5 소스 패키지 다운로드 wget http://cn2.php.net/distributions/php-5.6.37.tar.gz

다운받은 파일 tar -zxvf php-5.6.37.tar.gz

파일 디렉토리 입력 cd php-5.6 .37

configure ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-zlib-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl-dir=/usr/include/openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

View 오류 메시지

checking for xml2-config path… 
configure: error: xml2-config not found. Please check your libxml2 installation.

에 대한 해결 방법은 다음과 같습니다. 완료 후 configure

yum install libxml2-devel -y 
yum install libxml2 -y

를 실행하여 오류 메시지를 확인합니다.

configure:error: cannot find OpenSSL&#39;s <evp&#39;h>

완료 후 해결 방법은 다음과 같습니다. /include/openssl을 다시 실행할 때 --with-openssl-dir=/usr로 설정합니다. 또는 명령을 변경하지 않고 yum install -y openssl-devel을 직접 실행할 수도 있습니다.

export PHP_OPENSSL_DIR=yes

오류 메시지 보기

configure:error:please reinstall the BZip2 distribution

해결 방법은 다음과 같습니다. 완료 후 구성을 계속하세요

yum install bzip2-devel -y

오류 메시지 보기

configure:error:jpeglib.h not found

해결 방법은 다음과 같습니다. 구성을 계속하세요

yum install libjpeg-devel -y

오류 메시지 보기

png.h  not found

해결 후 구성 계속

yum install libpng-devel

오류 메시지 보기

freetype-config not found

메시지가 해결된 후 구성 계속

yum install freetype-devel -y

오류 메시지 확인

mcrypt.h not found please reinstall libmcrypt

해결 후 구성 계속

yum install libmcrypt-devel -y

PHP5를 설치하는 방법

경우 이 인터페이스가 나타나면 컴파일하고 설치할 수 있습니다.

make && make install

컴파일하고 설치한 후 파일을 복사하여 구성 파일을 만들어야 합니다. 소스 파일은 /usr/local/src/php-5.6.37, cp php에 있습니다. ini-development /usr/local/php/etc/php.ini

구성 파일이 로드되었는지 확인합니다. 이 명령은 컴파일 매개변수, 구성 경로 등을 포함한 PHP 정보를 확인할 수 있습니다.

/usr/local/php/bin/php -i |less

추천 학습: "PHP 비디오 튜토리얼"

위 내용은 PHP5를 설치하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.