程式教學

CentOS 7安裝Httpd, PHP, Laravel

更新

sudo yum –y update
sudo yum –y upgrade
sudo yum -y install yum-utils

安裝Httpd

//安裝Httpd
sudo yum install httpd
//開啟伺服器
sudo systemctl start httpd
//開機會自動開啟伺服器
sudo systemctl enable httpd

安裝PHP 7.1

sudo yum install epel-release
sudo wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo rpm -Uvh remi-release-7.rpm
sudo yum-config-manager --enable remi-php71
sudo yum -y install php php-opcache

沒有wget請執行

sudo yum install wget

重啟httpd

sudo yum update
sudo systemctl restart httpd.service

Install Laravel

sudo yum install composer
composer global require "laravel/installer"
composer create-project --prefer-dist laravel/laravel blog "5.6.*"

打開防火牆

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

關閉 SELinux

vi /etc/sysconfig/selinux

修改

SELINUX=enforcing

To

SELINUX=disabled

Leave a Reply

Your email address will not be published.