메뉴 건너뛰기

조회 수 7663 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

CentOS 7 에 php 설치하기 (디비와 아파치를 설치한후 마지막에 php를 설치한다.)

 

 

설치 가능한 php 버전을 확인해 본다.

확인해 보니 버전이 php 5.4.16 이다. 

[root@localhost ~]# yum list | grep php

graphviz-php.x86_64                     2.30.1-18.el7                  base     

php.x86_64                              5.4.16-23.el7_0.3              updates  

php-bcmath.x86_64                       5.4.16-23.el7_0.3              updates  

php-cli.x86_64                          5.4.16-23.el7_0.3              updates  

php-common.x86_64                       5.4.16-23.el7_0.3              updates  

php-dba.x86_64                          5.4.16-23.el7_0.3              updates  

php-devel.x86_64                        5.4.16-23.el7_0.3              updates  

php-embedded.x86_64                     5.4.16-23.el7_0.3              updates  

php-enchant.x86_64                      5.4.16-23.el7_0.3              updates  

php-fpm.x86_64                          5.4.16-23.el7_0.3              updates  

php-gd.x86_64                           5.4.16-23.el7_0.3              updates  

php-intl.x86_64                         5.4.16-23.el7_0.3              updates  

php-ldap.x86_64                         5.4.16-23.el7_0.3              updates  

php-mbstring.x86_64                     5.4.16-23.el7_0.3              updates  

php-mysql.x86_64                        5.4.16-23.el7_0.3              updates  

php-mysqlnd.x86_64                      5.4.16-23.el7_0.3              updates  

php-odbc.x86_64                         5.4.16-23.el7_0.3              updates  

php-pdo.x86_64                          5.4.16-23.el7_0.3              updates  

php-pear.noarch                         1:1.9.4-21.el7                 base     

php-pecl-memcache.x86_64                3.0.8-4.el7                    base     

php-pgsql.x86_64                        5.4.16-23.el7_0.3              updates  

php-process.x86_64                      5.4.16-23.el7_0.3              updates  

php-pspell.x86_64                       5.4.16-23.el7_0.3              updates  

php-recode.x86_64                       5.4.16-23.el7_0.3              updates  

php-snmp.x86_64                         5.4.16-23.el7_0.3              updates  

php-soap.x86_64                         5.4.16-23.el7_0.3              updates  

php-xml.x86_64                          5.4.16-23.el7_0.3              updates  

php-xmlrpc.x86_64                       5.4.16-23.el7_0.3              updates  

rrdtool-php.x86_64                      1.4.8-8.el7                    base     

uuid-php.x86_64                         1.6.2-26.el7                   base     

 

 

php를 설치한다.

중간에 y를 선택해 준다. 연관 패키지이다.

 

[root@localhost ~]# yum install php php-mysql php-gd php-pear

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: centos.tt.co.kr

 * extras: centos.tt.co.kr

 * updates: centos.tt.co.kr

Resolving Dependencies

--> Running transaction check

---> Package php.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: php-common(x86-64) = 5.4.16-23.el7_0.3 for package: php-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: php-cli(x86-64) = 5.4.16-23.el7_0.3 for package: php-5.4.16-23.el7_0.3.x86_64

---> Package php-gd.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

---> Package php-mysql.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: php-pdo(x86-64) = 5.4.16-23.el7_0.3 for package: php-mysql-5.4.16-23.el7_0.3.x86_64

---> Package php-pear.noarch 1:1.9.4-21.el7 will be installed

--> Processing Dependency: php-xml for package: 1:php-pear-1.9.4-21.el7.noarch

--> Processing Dependency: php-posix for package: 1:php-pear-1.9.4-21.el7.noarch

--> Running transaction check

---> Package php-cli.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-common.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-23.el7_0.3.x86_64

---> Package php-pdo.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-process.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-xml.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package t1lib.x86_64 0:5.1.2-14.el7 will be installed

--> Running transaction check

---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

================================================================================

 Package            Arch          Version                  Repository      Size

================================================================================

Installing:

 php                x86_64        5.4.16-23.el7_0.3        updates        1.3 M

 php-gd             x86_64        5.4.16-23.el7_0.3        updates        124 k

 php-mysql          x86_64        5.4.16-23.el7_0.3        updates         97 k

 php-pear           noarch        1:1.9.4-21.el7           base           357 k

Installing for dependencies:

 libzip             x86_64        0.10.1-8.el7             base            48 k

 php-cli            x86_64        5.4.16-23.el7_0.3        updates        2.7 M

 php-common         x86_64        5.4.16-23.el7_0.3        updates        561 k

 php-pdo            x86_64        5.4.16-23.el7_0.3        updates         95 k

 php-process        x86_64        5.4.16-23.el7_0.3        updates         52 k

 php-xml            x86_64        5.4.16-23.el7_0.3        updates        122 k

 t1lib              x86_64        5.1.2-14.el7             base           166 k

 

Transaction Summary

================================================================================

Install  4 Packages (+7 Dependent packages)

 

Total download size: 5.7 M

Installed size: 21 M

Is this ok [y/d/N]: y

Downloading packages:

(1/11): libzip-0.10.1-8.el7.x86_64.rpm                     |  48 kB   00:00     

(2/11): php-5.4.16-23.el7_0.3.x86_64.rpm                   | 1.3 MB   00:01     

(3/11): php-gd-5.4.16-23.el7_0.3.x86_64.rpm                | 124 kB   00:01     

(4/11): php-pdo-5.4.16-23.el7_0.3.x86_64.rpm               |  95 kB   00:00     

(5/11): php-common-5.4.16-23.el7_0.3.x86_64.rpm            | 561 kB   00:01     

(6/11): php-process-5.4.16-23.el7_0.3.x86_64.rpm           |  52 kB   00:00     

(7/11): php-xml-5.4.16-23.el7_0.3.x86_64.rpm               | 122 kB   00:00     

(8/11): php-mysql-5.4.16-23.el7_0.3.x86_64.rpm             |  97 kB   00:00     

(9/11): php-pear-1.9.4-21.el7.noarch.rpm                   | 357 kB   00:00     

(10/11): php-cli-5.4.16-23.el7_0.3.x86_64.rpm              | 2.7 MB   00:01     

(11/11): t1lib-5.1.2-14.el7.x86_64.rpm                     | 166 kB   00:00     

--------------------------------------------------------------------------------

Total                                              2.7 MB/s | 5.7 MB  00:02     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libzip-0.10.1-8.el7.x86_64                                  1/11 

  Installing : php-common-5.4.16-23.el7_0.3.x86_64                         2/11 

  Installing : php-cli-5.4.16-23.el7_0.3.x86_64                            3/11 

  Installing : php-pdo-5.4.16-23.el7_0.3.x86_64                            4/11 

  Installing : php-process-5.4.16-23.el7_0.3.x86_64                        5/11 

  Installing : php-xml-5.4.16-23.el7_0.3.x86_64                            6/11 

  Installing : t1lib-5.1.2-14.el7.x86_64                                   7/11 

  Installing : php-gd-5.4.16-23.el7_0.3.x86_64                             8/11 

  Installing : 1:php-pear-1.9.4-21.el7.noarch                              9/11 

  Installing : php-mysql-5.4.16-23.el7_0.3.x86_64                         10/11 

  Installing : php-5.4.16-23.el7_0.3.x86_64                               11/11 

  Verifying  : php-common-5.4.16-23.el7_0.3.x86_64                         1/11 

  Verifying  : php-pdo-5.4.16-23.el7_0.3.x86_64                            2/11 

  Verifying  : t1lib-5.1.2-14.el7.x86_64                                   3/11 

  Verifying  : php-process-5.4.16-23.el7_0.3.x86_64                        4/11 

  Verifying  : php-5.4.16-23.el7_0.3.x86_64                                5/11 

  Verifying  : php-gd-5.4.16-23.el7_0.3.x86_64                             6/11 

  Verifying  : php-xml-5.4.16-23.el7_0.3.x86_64                            7/11 

  Verifying  : php-mysql-5.4.16-23.el7_0.3.x86_64                          8/11 

  Verifying  : php-cli-5.4.16-23.el7_0.3.x86_64                            9/11 

  Verifying  : libzip-0.10.1-8.el7.x86_64                                 10/11 

  Verifying  : 1:php-pear-1.9.4-21.el7.noarch                             11/11 

 

Installed:

  php.x86_64 0:5.4.16-23.el7_0.3           php-gd.x86_64 0:5.4.16-23.el7_0.3    

  php-mysql.x86_64 0:5.4.16-23.el7_0.3     php-pear.noarch 1:1.9.4-21.el7       

 

Dependency Installed:

  libzip.x86_64 0:0.10.1-8.el7             php-cli.x86_64 0:5.4.16-23.el7_0.3  

  php-common.x86_64 0:5.4.16-23.el7_0.3    php-pdo.x86_64 0:5.4.16-23.el7_0.3  

  php-process.x86_64 0:5.4.16-23.el7_0.3   php-xml.x86_64 0:5.4.16-23.el7_0.3  

  t1lib.x86_64 0:5.1.2-14.el7             

 

Complete!

설치가 완료 되었다.

 

 

아파치를 재시작해 준다.

[root@localhost ~]# systemctl restart httpd.service

 

 

홈페이지에서 php 정보를 확인하기 위해 info.php 파일을 만든다.

[root@localhost ~]# vi /var/www/html/info.php

내용은 아래와 같이 입력한다.

<?php

   phpinfo();

?>

참고로 저장하고 빠져 나올때는 ESC 키를 누른 후에 손을 땐후

:wq

입력하면 저장후 빠져 나온다.

 

아파치를 재시작해 준다.

[root@localhost ~]# systemctl restart httpd.service

 

 

CentOS에 깔려 있는 브라우저 파이어 폭스를 실행해서 php 정보를 확인해 본다.

주소창에 입력

localhost/info.php

 

참고사항

PHP 설치 경로 : /usr/lib64/php

PHP 설정파일 경로 :  /etc/php.ini


  1. No Image

    CentOS 7 에 아파치(httpd) 설치

    Date2015.07.16 Views10302
    Read More
  2. No Image

    CentOS 7 에 php 설치하기

    Date2015.07.16 Views7663
    Read More
  3. No Image

    centos 7 계정추가

    Date2015.07.16 Views8598
    Read More
  4. No Image

    CentOS 7 Subversion(SVN)

    Date2015.07.17 Views7648
    Read More
  5. No Image

    CentOS 7 FTP Server 설치

    Date2015.07.17 Views7701
    Read More
  6. centos 7 APM 최신버전 설치 ( mariadb 10.4 / apache 2.4.39 / php 7.3.8 )

    Date2024.02.07 Views46
    Read More
  7. No Image

    CentOS 5.1 + APM(apache 2.2.x + php 5.2.x + mysql5.0.x + Zend 3.0.x) 설치

    Date2016.03.18 Views8686
    Read More
  8. No Image

    centos 4.x 데몬

    Date2014.02.27 Views6875
    Read More
  9. No Image

    CentOS 32Bit 운영체제에서 메모리 4G인식 시키는 방법

    Date2014.02.27 Views7103
    Read More
  10. No Image

    cdrom 마운트 하기

    Date2014.03.26 Views7102
    Read More
  11. No Image

    bitnami Redmine stack 업그레이드기 (1.2.x -> 2.0.x)

    Date2017.07.05 Views6835
    Read More
  12. bind , 네임서버 구축 ( CentOS 6.x)

    Date2016.04.22 Views7089
    Read More
  13. No Image

    bash 스크립트에서 네트워크 정보 확인하기

    Date2014.02.27 Views14276
    Read More
  14. No Image

    APM 소스 설치

    Date2014.02.27 Views7735
    Read More
  15. No Image

    APM 소스 설치

    Date2014.02.27 Views8068
    Read More
  16. No Image

    apache에서 전송 속도 제한하기

    Date2014.02.27 Views6940
    Read More
  17. No Image

    apachec rewrite 사용하기 // www 강제 사용 // HTTP to HTTPS // 특정경로만 HTTP

    Date2016.12.30 Views7081
    Read More
  18. No Image

    apache2 트래픽 모듈 mod_cband 사용법

    Date2019.02.14 Views1129
    Read More
  19. No Image

    APACHE, OHS 400 웹로직 연동후 특정 작업에 400 error

    Date2016.12.30 Views8645
    Read More
  20. No Image

    apache, mod_ssl 설치 (apache 1.3.37버전)

    Date2014.02.27 Views7667
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved