畢業設計項目
iview-admin + vue + thinkphp5 + mysql5.7
先在本地虛擬機部署測試
安裝完虛擬機后
先更換yum源
yum install wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update -y
安裝 nginx
yum install nginx -y
添加nginx yum 源
rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum install nginx -y 再來
有點兒慢等會吧
好了
- 啟動並嘗試訪問
systemctl restart nginx
systemctl enable nginx 開機自啟
- 防火牆問題
systemctl stop firewalld
systemctl disable firewalld
配置文件
/etc/nginx/nginx.conf
/etc/nginx/conf.d/default.conf 主要修改該文件
html文件默認路徑
/usr/share/nginx/html
-
將前端項目丟到默認路徑下
-
碰到兩個問題
-
刷新404
-
空白頁 conslog 報 Uncaught SyntaxError: Unexpected token <
部署thinkphp5
Appach + php7
添加 php7 的yum源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w
- 安裝Appach
yum install httpd -y
setenforce 0 臨時關閉selinux
vim /etc/selinux/config
SELINUX=permissive
修改端口(沖突)
修改以下
ServerSignature On => ServerSignature Off // 配置錯誤頁不顯示Apache版本
Options Indexes FollowSymLinks => Options FollowSymLinks // 配置Apache不能通過目錄層級進行文件訪問
AllowOverride None => AllowOverride All // 配置允許.htaccess
DirectoryIndex index.html => DirectoryIndex index.html index.php // 配置Apache支持.php文件解析
重啟服務
繼續
把tp5 項目丟到
/var/www/html/
修改入口
DocumentRoot "/var/www/html/public"
-
暫時是可以了,調用一下接口
-
缺少PDO模塊
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt -y
原文 https://blog.csdn.net/qq_29987661/article/details/84347527
- 不知道怎么重啟php
reboot
- 發現還是 Class 'PDO' not found
才想起來沒有配置模塊