๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๊ฐœ๋ฐœ์ด์•ผ๊ธฐ

Installing Laravel5.4 on CentOS 7 - 1

๋ฐ˜์‘ํ˜•

Laravel5.4 PHP ํ”„๋ ˆ์ž„์›Œํฌ ์„ค์น˜ ์ „, ์„œ๋ฒ„ ๊ตฌ์„ฑ




1. ์•„ํŒŒ์น˜ ์„ค์น˜ / ๋ฐฉํ™”๋ฒฝ ์„ค์ •


[root@localhost ~]# yum update -y


[root@localhost ~]# yum install httpd mod_ssl -y


Loaded plugins: fastestmirror, langpacks


base                                                     | 3.6 kB     00:00     


extras                                                   | 3.4 kB     00:00     


updates                                                  | 3.4 kB     00:00     


Loading mirror speeds from cached hostfile


 * base: mirror.navercorp.com


 * extras: mirror.navercorp.com


 * updates: mirror.navercorp.com


Resolving Dependencies


--> Running transaction check


---> Package httpd.x86_64 0:2.4.6-45.el7.centos.4 will be installed


--> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos.4 for package: httpd-2.4.6-45.el7.centos.4.x86_64


--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-45.el7.centos.4.x86_64


--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-45.el7.centos.4.x86_64


--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-45.el7.centos.4.x86_64


---> Package mod_ssl.x86_64 1:2.4.6-45.el7.centos.4 will be installed


--> Running transaction check


---> Package apr.x86_64 0:1.4.8-3.el7 will be installed


---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed


---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos.4 will be installed


---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed


--> Finished Dependency Resolution




Dependencies Resolved




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


 Package          Arch        Version                        Repository    Size


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


Installing:


 httpd            x86_64      2.4.6-45.el7.centos.4          updates      2.7 M


 mod_ssl          x86_64      1:2.4.6-45.el7.centos.4        updates      105 k


Installing for dependencies:


 apr              x86_64      1.4.8-3.el7                    base         103 k


 apr-util         x86_64      1.5.2-6.el7                    base          92 k


 httpd-tools      x86_64      2.4.6-45.el7.centos.4          updates       84 k


 mailcap          noarch      2.1.41-2.el7                   base          31 k




Transaction Summary


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


Install  2 Packages (+4 Dependent packages)




Total download size: 3.1 M


Installed size: 10 M


Downloading packages:


warning: /var/cache/yum/x86_64/7/updates/packages/httpd-tools-2.4.6-45.el7.centos.4.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY


Public key for httpd-tools-2.4.6-45.el7.centos.4.x86_64.rpm is not installed


(1/6): httpd-tools-2.4.6-45.el7.centos.4.x86_64.rpm        |  84 kB   00:00     


Public key for apr-1.4.8-3.el7.x86_64.rpm is not installed |  84 kB   --:-- ETA 


(2/6): apr-1.4.8-3.el7.x86_64.rpm                          | 103 kB   00:00     


(3/6): apr-util-1.5.2-6.el7.x86_64.rpm                     |  92 kB   00:00     


(4/6): mailcap-2.1.41-2.el7.noarch.rpm                     |  31 kB   00:00     


(5/6): mod_ssl-2.4.6-45.el7.centos.4.x86_64.rpm            | 105 kB   00:00     


(6/6): httpd-2.4.6-45.el7.centos.4.x86_64.rpm              | 2.7 MB   00:01     


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


Total                                              2.0 MB/s | 3.1 MB  00:01     


Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


Importing GPG key 0xF4A80EB5:


 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"


 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5


 Package    : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda)


 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


Running transaction check


Running transaction test


Transaction test succeeded


Running transaction


  Installing : apr-1.4.8-3.el7.x86_64                                       1/6 


  Installing : apr-util-1.5.2-6.el7.x86_64                                  2/6 


  Installing : httpd-tools-2.4.6-45.el7.centos.4.x86_64                     3/6 


  Installing : mailcap-2.1.41-2.el7.noarch                                  4/6 


  Installing : httpd-2.4.6-45.el7.centos.4.x86_64                           5/6 


  Installing : 1:mod_ssl-2.4.6-45.el7.centos.4.x86_64                       6/6 


  Verifying  : apr-1.4.8-3.el7.x86_64                                       1/6 


  Verifying  : mailcap-2.1.41-2.el7.noarch                                  2/6 


  Verifying  : apr-util-1.5.2-6.el7.x86_64                                  3/6 


  Verifying  : 1:mod_ssl-2.4.6-45.el7.centos.4.x86_64                       4/6 


  Verifying  : httpd-tools-2.4.6-45.el7.centos.4.x86_64                     5/6 


  Verifying  : httpd-2.4.6-45.el7.centos.4.x86_64                           6/6 




Installed:


  httpd.x86_64 0:2.4.6-45.el7.centos.4  mod_ssl.x86_64 1:2.4.6-45.el7.centos.4 




Dependency Installed:


  apr.x86_64 0:1.4.8-3.el7                      apr-util.x86_64 0:1.5.2-6.el7   


  httpd-tools.x86_64 0:2.4.6-45.el7.centos.4    mailcap.noarch 0:2.1.41-2.el7   




Complete!



#๋ฐฉํ™”๋ฒฝ ์„ค์ •


[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=http


success


[root@localhost ~]# firewall-cmd --reload



success


[root@localhost ~]# systemctl restart httpd




#์›น์„œ๋ฒ„ ์ ‘์†ํ™•์ธ

[root@localhost ~]# echo 'test' > /var/www/html/index.html

[root@localhost ~]# curl http://localhost

test



2. PHP ์„ค์น˜

[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm


[root@localhost ~]# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm


[root@localhost ~]# yum install --enablerepo=webtatic php70w php70w-common php70w-fpm php70w-cli php70w-opcache php70w-mbstring php70w-mcrypt php70w-mysql php70w-pgsql php70w-pdo php70w-xml


Loaded plugins: fastestmirror, langpacks


epel/x86_64/metalink                                     | 7.0 kB     00:00     


epel                                                     | 4.3 kB     00:00     


webtatic                                                 | 3.6 kB     00:00     


(1/5): epel/x86_64/group_gz                                | 170 kB   00:00     


epel/x86_64/primary_db         FAILED                                          


https://ftp.yz.yamagata-u.ac.jp/pub/linux/fedora-projects/epel/7/x86_64/repodata/83a42d3c5c30e29fafc333706513304b43fd07e0783c2da67441b983c099e66c-primary.sqlite.xz: [Errno 14] HTTPS Error 404 - Not Found


Trying other mirror.


To address this issue please refer to the below knowledge base article 




https://access.redhat.com/articles/1320623




If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/




(2/5): webtatic/x86_64/group_gz                            |  448 B   00:00     


(3/5): webtatic/x86_64/primary_db                          | 203 kB   00:01     


(4/5): epel/x86_64/primary_db                              | 4.8 MB   00:01     


epel/x86_64/updateinfo         FAILED                                          


https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/repodata/600be3fedcfb99a7b3844ec67c6a6f46f19725ba7d7900fce0aed98b84f1a280-updateinfo.xml.bz2: [Errno 14] HTTPS Error 404 - Not Found


Trying other mirror.


(5/5): epel/x86_64/updateinfo                              | 783 kB   00:00     


Loading mirror speeds from cached hostfile


 * base: mirror.navercorp.com


 * epel: mirror.premi.st


 * extras: mirror.navercorp.com


 * updates: mirror.navercorp.com


 * webtatic: sp.repo.webtatic.com


Resolving Dependencies


--> Running transaction check


---> Package php70w.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-cli.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-common.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-fpm.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-mbstring.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-mcrypt.x86_64 0:7.0.20-1.w7 will be installed


--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php70w-mcrypt-7.0.20-1.w7.x86_64


---> Package php70w-mysql.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-opcache.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-pdo.x86_64 0:7.0.20-1.w7 will be installed


---> Package php70w-pgsql.x86_64 0:7.0.20-1.w7 will be installed


--> Processing Dependency: libpq.so.5()(64bit) for package: php70w-pgsql-7.0.20-1.w7.x86_64


---> Package php70w-xml.x86_64 0:7.0.20-1.w7 will be installed


--> Running transaction check


---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed


---> Package postgresql-libs.x86_64 0:9.2.18-1.el7 will be installed


--> Finished Dependency Resolution




Dependencies Resolved




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


 Package                Arch          Version             Repository       Size


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


Installing:


 php70w                 x86_64        7.0.20-1.w7         webtatic        2.8 M


 php70w-cli             x86_64        7.0.20-1.w7         webtatic        2.9 M


 php70w-common          x86_64        7.0.20-1.w7         webtatic        1.2 M


 php70w-fpm             x86_64        7.0.20-1.w7         webtatic        1.5 M


 php70w-mbstring        x86_64        7.0.20-1.w7         webtatic        543 k


 php70w-mcrypt          x86_64        7.0.20-1.w7         webtatic         27 k


 php70w-mysql           x86_64        7.0.20-1.w7         webtatic         83 k


 php70w-opcache         x86_64        7.0.20-1.w7         webtatic        129 k


 php70w-pdo             x86_64        7.0.20-1.w7         webtatic         92 k


 php70w-pgsql           x86_64        7.0.20-1.w7         webtatic         89 k


 php70w-xml             x86_64        7.0.20-1.w7         webtatic        130 k


Installing for dependencies:


 libmcrypt              x86_64        2.5.8-13.el7        epel             99 k


 postgresql-libs        x86_64        9.2.18-1.el7        base            232 k




Transaction Summary


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


Install  11 Packages (+2 Dependent packages)




Total download size: 9.7 M


Installed size: 37 M


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


Downloading packages:


warning: /var/cache/yum/x86_64/7/epel/packages/libmcrypt-2.5.8-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY


Public key for libmcrypt-2.5.8-13.el7.x86_64.rpm is not installed


(1/13): libmcrypt-2.5.8-13.el7.x86_64.rpm                  |  99 kB   00:00     


warning: /var/cache/yum/x86_64/7/webtatic/packages/php70w-fpm-7.0.20-1.w7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY


Public key for php70w-fpm-7.0.20-1.w7.x86_64.rpm is not installed


(2/13): php70w-fpm-7.0.20-1.w7.x86_64.rpm                  | 1.5 MB   00:03     


(3/13): php70w-mbstring-7.0.20-1.w7.x86_64.rpm             | 543 kB   00:03     


(4/13): php70w-mysql-7.0.20-1.w7.x86_64.rpm                |  83 kB   00:00     


(5/13): php70w-opcache-7.0.20-1.w7.x86_64.rpm              | 129 kB   00:00     


(6/13): php70w-pdo-7.0.20-1.w7.x86_64.rpm                  |  92 kB   00:00     


(7/13): php70w-mcrypt-7.0.20-1.w7.x86_64.rpm               |  27 kB   00:01     


(8/13): php70w-pgsql-7.0.20-1.w7.x86_64.rpm                |  89 kB   00:00     


(9/13): postgresql-libs-9.2.18-1.el7.x86_64.rpm            | 232 kB   00:00     


(10/13): php70w-xml-7.0.20-1.w7.x86_64.rpm                 | 130 kB   00:00     


(11/13): php70w-7.0.20-1.w7.x86_64.rpm                     | 2.8 MB   00:06     


(12/13): php70w-common-7.0.20-1.w7.x86_64.rpm              | 1.2 MB   00:07     


(13/13): php70w-cli-7.0.20-1.w7.x86_64.rpm                 | 2.9 MB   00:11     


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


Total                                              845 kB/s | 9.7 MB  00:11     


Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7


Importing GPG key 0x62E74CA5:


 Userid     : "Webtatic EL7 <rpms@webtatic.com>"


 Fingerprint: 830d b159 6d9b 9b01 99dc 24a3 e87f d236 62e7 4ca5


 Package    : webtatic-release-7-3.noarch (installed)


 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-el7


Is this ok [y/N]: y


Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


Importing GPG key 0x352C64E5:


 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"


 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5


 Package    : epel-release-7-5.noarch (installed)


 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


Is this ok [y/N]: y


Running transaction check


Running transaction test


Transaction test succeeded


Running transaction


Warning: RPMDB altered outside of yum.


** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:


ipa-client-4.4.0-12.el7.centos.x86_64 has installed conflicts freeipa-client: ipa-client-4.4.0-12.el7.centos.x86_64


ipa-client-common-4.4.0-12.el7.centos.noarch has installed conflicts freeipa-client-common: ipa-client-common-4.4.0-12.el7.centos.noarch


ipa-common-4.4.0-12.el7.centos.noarch has installed conflicts freeipa-common: ipa-common-4.4.0-12.el7.centos.noarch


  Installing : php70w-common-7.0.20-1.w7.x86_64                            1/13 


  Installing : php70w-pdo-7.0.20-1.w7.x86_64                               2/13 


  Installing : php70w-cli-7.0.20-1.w7.x86_64                               3/13 


  Installing : libmcrypt-2.5.8-13.el7.x86_64                               4/13 


  Installing : postgresql-libs-9.2.18-1.el7.x86_64                         5/13 


  Installing : php70w-pgsql-7.0.20-1.w7.x86_64                             6/13 


  Installing : php70w-mcrypt-7.0.20-1.w7.x86_64                            7/13 


  Installing : php70w-7.0.20-1.w7.x86_64                                   8/13 


  Installing : php70w-mysql-7.0.20-1.w7.x86_64                             9/13 


  Installing : php70w-xml-7.0.20-1.w7.x86_64                              10/13 


  Installing : php70w-mbstring-7.0.20-1.w7.x86_64                         11/13 


  Installing : php70w-fpm-7.0.20-1.w7.x86_64                              12/13 


  Installing : php70w-opcache-7.0.20-1.w7.x86_64                          13/13 


  Verifying  : php70w-xml-7.0.20-1.w7.x86_64                               1/13 


  Verifying  : php70w-cli-7.0.20-1.w7.x86_64                               2/13 


  Verifying  : php70w-pdo-7.0.20-1.w7.x86_64                               3/13 


  Verifying  : php70w-mcrypt-7.0.20-1.w7.x86_64                            4/13 


  Verifying  : postgresql-libs-9.2.18-1.el7.x86_64                         5/13 


  Verifying  : php70w-mysql-7.0.20-1.w7.x86_64                             6/13 


  Verifying  : php70w-mbstring-7.0.20-1.w7.x86_64                          7/13 


  Verifying  : php70w-pgsql-7.0.20-1.w7.x86_64                             8/13 


  Verifying  : php70w-common-7.0.20-1.w7.x86_64                            9/13 


  Verifying  : php70w-7.0.20-1.w7.x86_64                                  10/13 


  Verifying  : libmcrypt-2.5.8-13.el7.x86_64                              11/13 


  Verifying  : php70w-fpm-7.0.20-1.w7.x86_64                              12/13 


  Verifying  : php70w-opcache-7.0.20-1.w7.x86_64                          13/13 




Installed:


  php70w.x86_64 0:7.0.20-1.w7             php70w-cli.x86_64 0:7.0.20-1.w7       


  php70w-common.x86_64 0:7.0.20-1.w7      php70w-fpm.x86_64 0:7.0.20-1.w7       


  php70w-mbstring.x86_64 0:7.0.20-1.w7    php70w-mcrypt.x86_64 0:7.0.20-1.w7    


  php70w-mysql.x86_64 0:7.0.20-1.w7       php70w-opcache.x86_64 0:7.0.20-1.w7   


  php70w-pdo.x86_64 0:7.0.20-1.w7         php70w-pgsql.x86_64 0:7.0.20-1.w7     


  php70w-xml.x86_64 0:7.0.20-1.w7        




Dependency Installed:


  libmcrypt.x86_64 0:2.5.8-13.el7     postgresql-libs.x86_64 0:9.2.18-1.el7    




Complete!



#PHP ์„ค์ • (์ถœ์ฒ˜ : http://oerun.tistory.com/2)


[root@localhost ~]# cp -av /etc/php.ini /etc/php.ini.original


โ€˜/etc/php.iniโ€™ -> โ€˜/etc/php.ini.originalโ€™


[root@localhost ~]# sed -i 's/short_open_tag = Off/short_open_tag = On/' /etc/php.ini


[root@localhost ~]# sed -i 's/expose_php = On/expose_php = Off/' /etc/php.ini


[root@localhost ~]# sed -i 's/display_errors = Off/display_errors = On/' /etc/php.ini


[root@localhost ~]# sed -i 's/;error_log = php_errors.log/error_log = php_errors.log/' /etc/php.ini


[root@localhost ~]# sed -i 's/error_reporting = E_ALL \& ~E_DEPRECATED/error_reporting = E_ALL \& ~E_NOTICE \& ~E_DEPRECATED \& ~E_USER_DEPRECATED/' /etc/php.ini


[root@localhost ~]# sed -i 's/variables_order = "GPCS"/variables_order = "EGPCS"/' /etc/php.ini


[root@localhost ~]# sed -i 's/post_max_size = 8M/post_max_size = 100M/' /etc/php.ini


[root@localhost ~]# sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 100M/' /etc/php.ini


[root@localhost ~]# sed -i 's/;date.timezone =/date.timezone = "Asia\/Seoul"/' /etc/php.ini


[root@localhost ~]# sed -i 's/session.gc_maxlifetime = 1440/session.gc_maxlifetime = 86400/' /etc/php.ini


[root@localhost ~]# systemctl restart httpd



#์„ค์ • ํ™•์ธ

[root@localhost ~]# echo '<? echo phpinfo(); ?>' >>/var/www/html/phpinfo.php


http://localhost/phpinfo.php