完整Laravel环境搭建记录
php安装
- 相关依赖安装
yum -y install libxml2 libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libicu-devel libmcrypt openssl openssl-devel glibc-headers gcc-c++
- 到官网找一个适合的php源码包,下载回来之后解压/编译安装
wget https://www.php.net/distributions/php-7.2.19.tar.gz
tar -zxvf php-7.2.19.tar.gz
# 配置, 这个可以按照个人习惯更改路径等
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-intl --enable-pcntl --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-xsl
# 编译安装
make
make test
make install
- 默认的配置
# 找到php-fpm
find / -name "php-fpm"
# copy默认配置
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# 如果没有php.ini,就把php.ini 从源码包中copy出来
cp /root/php-package/php-7.2.19/php.ini-production /usr/local/php/etc/php.ini
- 给php创建一个用户组/用户
groupadd www
useradd -g www www
- 启动
/usr/local/php/sbin/php-fpm
- 安装composer
# 移动一下php方便使用
cp /usr/local/php/bin/php /usr/bin/
# 安装官方操作 https://getcomposer.org/download/
# 移动一下方便全局调用
mv composer.phar /usr/bin/composer
- 安装扩展(laravel需要
# 安装aotuconf
yum -y install autoconf
# 源码安装包里
cd /root/php-package/php-7.2.19/ext/fileinfo
# 执行
/usr/local/php/bin/phpize
# 某些情况perl会报错(待研究),需要另外设置环境变量
export LC_ALL=C
# 配置
./configure --with-php-config=/usr/local/php/bin/php-config
# make的时候发现不够内存,弄一下交换区。参考 https://www.jb51.net/article/138132.htm
dd if=/dev/zero of=~/swap_zone/centos-swap bs=1024 count=2048000
mkswap /root/swap_zone/centos-swap
mkswap -f /root/swap_zone/centos-swap
swapon /root/swap_zone/centos-swap
# 开启自启
# vim /etc/fstab
# 添加 /root/swap_zone/centos-swap swap swap default 0 0
# 继续装扩展
make test
make install
# 找到扩展存放路径
/usr/local/php/bin/php-config --extension-dir
# 在php.ini中添加配置
extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/fileinfo.so
nginx 安装
- 安装依赖
yum install -y gcc openssl-devel pcre-devel zlib-devel
- 创建用户
groupadd -r nginx
useradd -r -g nginx -s /sbin/nologin -M nginx
- 下载源码包
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar -zxvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
- 配置,编译,安装
-> ./configure --prefix=/usr/local/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --http-scgi-temp-path=/var/tmp/nginx/scgi --with-pcre
make
make instal
mysql 8
- 依赖安装
yum -y install wget cmake gcc gcc-c++ ncurses ncurses-devel libaio-devel openssl openssl-devel
- 下载源码包
# 需要带boost的版本
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.16.tar.gz
tar -zxvf mysql-boost-8.0.16.tar.gz
- 创建用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
- 创建安装目录和数据目录
mkdir -p /usr/local/mysql
mkdir -p /data/mysql
- 安装cmake3
yum install -y cmake3
- 编译
-> cmake3 . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DWITH_BOOST=/usr/local/mysql-8.0.16/boost
# 这个时候遇到了错误:
Please do not build in-source. Out-of source builds are highly recommended: you can have multiple builds for the same source, and there is an easy way to do cleanup, simply remove the build directory (note that 'make clean' or 'make distclean' does *not* work)
You *can* force in-source build by invoking cmake with -DFORCE_INSOURCE_BUILD=1
-- Configuring incomplete, errors occurred!
See also "/root/mysql-package/mysql-8.0.16/CMakeFiles/CMakeOutput.log".
# 参考文章:https://blog.csdn.net/boyheroes/article/details/88652367
# 按照文章上的操作失败, 估计是和cmake版本有关。 暂时放弃源码使用yum源安装
- yum源安装
# 在官网找到对应系统的yum源
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# 安装yum源
yum install -y mysql80-community-release-el7-3.noarch.rpm
# 安装mysql服务
yum install -y mysql-community-server
# 安装完成之后直接启动
systemctl start mysqld
- 修改密码
# 获取默认密码
cat /var/log/mysqld.log
# 登陆进去之后,先修改密码策略,再修改密码
set global validate_password.policy=LOW;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '*********';
# 添加远程登录的账号
create user root@'%' identified by '******';
grant all privileges on *.* to root@'%';
flush privileges;
- 远程登录
# 登陆的时候遇到报错 :Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found
# 所以进行密码加密修改
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '********';
redis
- 下载,编译,安装
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar zxvf redis-5.0.5.tar.gz
cd redis-5.0.5
make
make test
# make test报错 :You need tcl 8.5 or newer in order to run the Redis test
# 安装 tcl
yum install -y tcl
# 再次make test检查
make test
# 再次报错 *** [err]: Active defrag big keys in tests/unit/memefficiency.tcl Expected condition '$max_latency <= 120' to be true (125 <= 120)
# 相关文章: https://blog.csdn.net/qq_36711420/article/details/83416155
# 忽略,直接安装
make install PREFIX=/usr/local/redis
- 配置文件编辑
# 找回默认的配置
find / -name "redis.conf"
# 迁到 etc 上
cp /root/redis-package/redis-5.0.5/redis.conf /etc/redis.conf
- 启动
# 参考文章,添加redis启动到systemctl中 https://blog.csdn.net/sinat_16181325/article/details/78966248
cd /lib/systemd/system
vim redis.service
systemctl daemon-reload
systemctl start redis
nodejs
- 直接yum安装
yum install -y nodejs
- nodejs版本管理
# node.js版本管理器n
npm install -g n
- yarn
# 更新到最新
n latest
# 安装yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
yum install -y yarn
项目部署
- git把项目拉下来
- composer install
- 配置nginx
- 配置.env 文件
- 日志文件权限
- 前端文件build
- DNS调整
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 여러 방향으로 몰아칠 예상이다. 우선 해외 비용과 토종 금액 간의 생존 경쟁이 격화하게 됐다. 거북목베개 업계는 “이베이 계열 기업과 쿠팡, 아마존-16번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최고로 먼저 타격을 받을 것'이라며 '신선식품과 생활용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 영향을 받게 될 것”이라고 내다보고 있다.
거북목베개
Now not ought to IG粉絲增加 users be confined to their unique voices when speaking with people, talking about company issues or conducting extensive-distance interviews.
FB粉絲專頁
Now not should Facebook 廣告 end users be confined to their unique voices though speaking to households, discussing business issues or conducting lengthy-length interviews.
買 like
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 다체로운 방향으로 몰아칠 예상이다. 우선 해외 자금과 토종 자본 간의 생존 경쟁이 격화하게 됐다. 일자목베개 업계는 “이베이 계열 회사와 쿠팡, 아마존-14번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최대로 우선해서 충격을 받을 것'이라며 '신선식품과 생사용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 영향을 받게 될 것”이라고 내다보고 있습니다.
옆으로자는베개
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 여러 방향으로 몰아칠 전망이다. 우선 해외 비용과 토종 비용 간의 생존 경쟁이 격화하게 됐다. 메인 레플리카시계 업계는 “이베이 계열 업체와 쿠팡, 아마존-15번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 가장 우선해서 충격을 받을 것'이라며 '신선식품과 생사용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 영향을 받게 될 것”이라고 내다보고 있습니다.
금통시계제작
Not need to Facebook 廣告 consumers be confined to their particular voices although speaking with family members, talking about business issues or conducting very long-distance interviews.
買 IG follower
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 여러 방향으로 몰아칠 예상이다. 우선 국내 자본과 토종 자본 간의 생존 경쟁이 격화하게 됐다. vs서브마리너 업계는 “이베이 계열 기업과 쿠팡, 아마존-17번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최고로 우선해서 충격을 받을 것'이라며 '신선식품과 생활용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 영향을 받게 될 것”이라고 내다보고 있습니다.
메인 레플리카시계
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 여러 방향으로 몰아칠 전망이다. 우선 국내외 금액과 토종 자본 간의 생존 경쟁이 격화하게 됐다. 클린서브마리너 업계는 “이베이 계열 회사와 쿠팡, 아마존-15번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최고로 우선해서 충격을 받을 것'이라며 '신선식품과 생활용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 효과를 받게 될 것”이라고 내다보고 있을 것이다.
금통시계제작
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 다양한 방향으로 몰아칠 예상이다. 우선 해외 돈과 토종 자금 간의 생존 경쟁이 격화하게 됐다. 일자목베개 업계는 “이베이 계열 업체와 쿠팡, 아마존-16번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최고로 최선으로 타격을 받을 것'이라며 '신선식품과 생활용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 효과를 받게 될 것”이라고 내다보고 있을 것입니다.
목디스크베개
No longer need to 日本人 インスタ フォロワー customers be confined to their own personal voices even though conversing with families, discussing enterprise issues or conducting extended-length interviews.
Twitter リツイート
Not will have to IG增加粉絲 users be confined to their unique voices when speaking to family members, talking about organization issues or conducting lengthy-length interviews.
IG 留言
Not ought to Tiktok フォロワー 増やす customers be confined to their unique voices although speaking to families, discussing business matters or conducting very long-distance interviews.
Twitter フォロワー 増やす
No more have to FB買粉絲 users be confined to their very own voices when conversing with family members, talking about business matters or conducting very long-distance interviews.
IG 留言
让我们今晚难忘...你的地方还是我的? - https://rb.gy/es66fc?tosy
Not must IG粉絲 users be confined to their own personal voices although conversing with family members, talking about organization matters or conducting lengthy-distance interviews.
IG買粉絲
成为第一个收到官方特朗普Memcoin并加入我们的社区
Join the Trump Community. This is History in the Making!
$TRUMP are now freely tradeable on the blockchain.
Claim Airdrop $TRUMP NOW
You personal promocod - "159mwx"
Hello, i read your blog from time to time and i own a similar
one and i was just wondering if you get a lot of spam comments?
If so how do you reduce it, any plugin or anything you
can advise? I get so much lately it's driving me insane so any help is very much appreciated.
差点以为这条是真人发的,翻译了一下这个韩文,居然是个赌场的网页😡。现在的垃圾评论真的超级多,他们机器人也越来越高级了。 反垃圾在互联网真的是一件任重而道远的事情。
刚刚加了评论过滤器不会再有垃圾消息了,前面的垃圾评论我有时间的时候再处理,肥肠抱歉😓