完整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 国际许可协议 进行许可。
大特価代引きビィトン 財布 ルイビトン 鞄 m56389 m61215 n63095 m51165 ビトンカバン ビィトン 財布 ルイビトン 新作 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m51855 n45255 m62545 m61725 ビィトン 財布 ビィトン 財布 ビトン 長 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m42616 n63209 n51304 n51131 ビィトン 財布 ルイビトン 小物 ビトン 二 つ折り 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m61726 m47515 m47515 n63095 ビトン 二 つ折り 財布 ビィトン 財布 ビィトン 長 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m61215 m60531 m69353 m61660 ビトン 長 財布 ビィトン 財布 ルイビトン 財布 黒
大特価代引きビィトン 財布 ルイビトン 鞄 n62665 m62545 n62665 ビィトン 財布 ビトン 二 つ折り 財布 ビィトン 長 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m51151 m51165 n51131 m51165 ビィトン 財布 ビィトン 財布 ルイビトン 折りたたみ 財布
大特価代引きビィトン 財布 ルイビトン 鞄 m51165 m64421 m62121 n42240 ポルトフォイユ ヴィクトリー ヌ ルイビトン 鞄 ルイビトン 折りたたみ 財布
大特価代引きビィトン 財布 ルイビトン 鞄 n51304 m51855 m41522 ポルトフォイユ クレア ポルトフォイユ ブラザ ビトン 長 財布
大特価代引きビィトン 財布 ルイビトン 鞄 ビトン 二 つ折り 財布 ビィトン 長 財布 ビトン 財布 二 つ折り ルイビトン 折りたたみ 財布 ルイビトン 新作 財布 ビトン 鞄
大特価代引きビィトン 財布 ルイビトン 鞄 m60742 m61734 n51131 m61674 ルイビトン 折りたたみ 財布 ポルトモネロザリ 長 財布 ビトン
大特価代引きビィトン 財布 ルイビトン 鞄 m61215 m47515 n42240 m60742 ポルトモネロザリ ポルトフォイユ クレア ポルトフォイユ ブラザ
大特価代引き ルイビトン 長 財布 ビトン 長 財布 ビィトン 長 財布 ルイビトン 折りたたみ 財布 ビトン 長 財布 ポルトフォイユ クレア 長 財布 ビトン
大特価代引き ルイビトン 長 財布 ルイビトン 折りたたみ 財布 ビィトン 財布 草間 彌生 ルイビトン 新作 財布 ポルトフォイユ ヴィクトリー ヌ ビトン 長 財布 ビトン 財布 二 つ折り
大特価代引き ルイ ヴィトン 長 財布 ルイビトン 長 財布 長 財布 ルイビトン ルイビトン 長 財布 ヴィトン 長 財布 ヴィトン 財布 ピンク
在 CentOS 7 上执行 yum -y install libxml2 libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libicu-devel libmcrypt openssl openssl-devel glibc-headers gcc-c++ 后,仍然在 ./configure 阶段出现 “libxml2 not found” 错误。请问还有哪些依赖包需要手动安装,或者该如何确认已正确安装 libxml2-devel? Gonna wager 2026 Mundial matches every kickoff? Lowkey wouldn't do it before verified tips — saved my profit last streak. Peep the spot ASAP.
Migliori siti di scommesse per i Mondiali 2026
I think what you posted made a great deal of sense.
However, what about this? suppose you typed a catchier title?
I mean, I don't want to tell you how to run your blog, but what
if you added something that grabbed a person's attention? I mean 完整Laravel环境搭建记录 - Guozhang Wu's Blog - 吴国章的博客 is a little plain. You ought to peek at Yahoo's front page and see how
they create post titles to grab viewers interested.
You might add a related video or a pic or two to get readers
interested about everything've written. In my opinion, it would make your
posts a little bit more interesting.
Promo: C4bjWthY7dcX8qi
我正在使用 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 所需的基礎庫,但安裝過程中仍提示缺少某些擴展(如 gd、mbstring)。請問在 CentOS(7/8)環境下,完整的 PHP 編譯/安裝依賴清單應該包括哪些套件,是否有額外需要手動安裝的庫或步驟?
Лучшие драм, которые заставят вас плакать! Смотрите бесплатно doramaland
领先的成人网站 为成熟观众提供优质内容。探索
经过验证的成人网站 以确保质量和隐私。
露骨材料平台 提供广泛的成人娱乐视频选择。选择 有保障的色情中心 以获得保密体验。
我已按照論壇提供的指令 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 時收到 “cannot find xml2.h” 的錯誤。請問是否還有其他必須安裝的套件,或是需要額外設定環境變數或建立符號鏈接才能解決此問題?
ТОП-5 дорам с айдолами! Список, который вас удивит! dorama