完整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 国际许可协议 进行许可。
Now not must Tiktok いいね buyers be confined to their own voices when speaking with people, talking about small business issues or conducting extended-length interviews.
Youtube 登録者 増やす
‘아마존발(發) 격랑은 인터넷 쇼핑 업계에 다체로운 방향으로 몰아칠 전망이다. 우선 국내외 금액과 토종 돈 간의 생존 경쟁이 격화하게 됐다. 모바일상품권 현금화 업계는 “이베이 계열 회사와 쿠팡, 아마존-14번가 간의 경쟁 격화로 인터파크·위메프·티몬 등 토종 중소 쇼핑몰이 최고로 최선으로 타격을 받을 것'이라며 '신선식품과 생활용품 시장으로 싸움이 확대하면서 신세계의 ‘쓱닷컴, 롯데쇼핑의 ‘롯데온 등도 영향을 받게 될 것”이라고 내다보고 있다.
상품권현금화
No more must IG增加粉絲 customers be confined to their own voices when speaking to family members, discussing small business issues or conducting very long-length interviews.
IG追蹤
Now not have to IG 演算法 end users be confined to their unique voices even though talking to people, talking about organization issues or conducting long-distance interviews.
買 like
Now not need to インスタ いいね 増やす customers be confined to their very own voices although conversing with households, speaking about company matters or conducting extensive-distance interviews.
Youtube 再生回数 購入
I don抰 even understand how I stopped up here, however I thought this post was once good. I do not recognize who you might be however certainly you're going to a well-known blogger for those who aren't already ;) Cheers!
No longer ought to IG 演算法 customers be confined to their own voices whilst speaking to families, speaking about company issues or conducting prolonged-distance interviews.
買 like
What you published made a lot of sense. But, what about this?
suppose you added a little information? I am not saying your information isn't good., but suppose you added something that
grabbed folk's attention? I mean 完整Laravel环境搭建记录 - Guozhang
Wu's Blog - 吴国章的博客 is a little vanilla.
You might peek at Yahoo's front page and watch how they create
news titles to grab people to open the links. You might try adding a video or a related picture or two to get readers excited about
everything've got to say. Just my opinion, it might make your blog a little bit more interesting.
Now not will have to Youtube 再生時間 購入 people be confined to their very own voices even though speaking with people, discussing business matters or conducting extensive-distance interviews.
Youtube 再生回数 買う
No more ought to IG粉絲增加 consumers be confined to their own voices although talking to families, discussing company matters or conducting extended-length interviews.
IG粉絲增加
No longer need to Youtube 買like customers be confined to their own individual voices whilst speaking to family members, discussing enterprise matters or conducting extended-length interviews.
Youtube 買like
No more should 買 like end users be confined to their own voices though speaking to families, discussing business matters or conducting prolonged-distance interviews.
買 like
No longer must IG粉絲 end users be confined to their own individual voices even though talking to people, speaking about business issues or conducting very long-distance interviews.
IG推廣
Not have to IG粉絲增加 users be confined to their unique voices even though talking to family members, talking about organization issues or conducting lengthy-distance interviews.
FB粉絲專頁
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.
差点以为这条是真人发的,翻译了一下这个韩文,居然是个赌场的网页😡。现在的垃圾评论真的超级多,他们机器人也越来越高级了。 反垃圾在互联网真的是一件任重而道远的事情。
刚刚加了评论过滤器不会再有垃圾消息了,前面的垃圾评论我有时间的时候再处理,肥肠抱歉😓