美文网首页
环境布置脚本

环境布置脚本

作者: 二手三流科学家 | 来源:发表于2020-07-29 16:57 被阅读0次
  1. Laravel框架
yum install -y systemd-devel  libxml2-devel openssl-devel 

php-7.2.32
按照Laravel官网给出的安装要求:
https://laravel.com/docs/6.x,结合php-docker配置文件的安装路径
得到下面的编译选项

./configure \
--with-libdir=/lib64 \
--with-config-file-path=/usr/local/etc/php \
--with-config-file-scan-dir=/usr/local/etc/php/conf.d \
--enable-cli \
--disable-cgi \
--enable-fpm \
--with-fpm-systemd \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-phar \
--with-pear  \
--disable-all \
--enable-pdo  \
--enable-mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-bcmath\
--enable-ctype\
--enable-fileinfo\
--enable-json\
--enable-mbstring\
--with-openssl\
--enable-tokenizer\
--enable-xml

然后提示

Configuring PEAR
checking whether to install PEAR... yes
configure: error: 
                    PEAR requires XML to be enabled.     Add --enable-xml to the configure line.


configure: error: XML extension requires LIBXML extension, add --enable-libxml

最新版

./configure --with-libdir=/lib64\
--with-config-file-path=/usr/local/etc/php\
--with-config-file-scan-dir=/usr/local/etc/php/conf.d\
--enable-cli\
--disable-cgi\
--enable-fpm\
--with-fpm-systemd\
--with-fpm-user=nginx\
--with-fpm-group=nginx\
--enable-phar\
--with-pear\
--disable-all\
--enable-pdo\
--enable-mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-bcmath\
--enable-ctype\
--enable-fileinfo\
--enable-json\
--enable-mbstring\
--with-openssl\
--enable-tokenizer\
--enable-xml\
--enable-libxml

安装完成后

php -m

[PHP Modules]
bcmath
Core
ctype
date
fileinfo
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
Phar
Reflection
SPL
standard
tokenizer
xml

[Zend Modules]

在安装目录下就有php.ini-development
cp /usr/local/php-7.2.32/php.ini-development /usr/local/etc/php/php.ini

有一个问题:/usr/local/etc 这个目录在编译php前存在么?

然后,安装composer

curl -sS https://getcomposer.org/installer | php

得到

Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The filter extension is missing.
Install it or recompile php without --disable-filter

The hash extension is missing.
Install it or recompile php without --disable-hash

然后,我们的PHP编译参数变为如下版本:

./configure\
--with-libdir=/lib64\
--with-config-file-path=/usr/local/etc/php\
--with-config-file-scan-dir=/usr/local/etc/php/conf.d\
--enable-cli\
--disable-cgi\
--enable-fpm\
--with-fpm-systemd\
--with-fpm-user=nginx\
--with-fpm-group=nginx\
--enable-phar\
--with-pear\
--disable-all\
--enable-pdo\
--enable-mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-bcmath\
--enable-ctype\
--enable-fileinfo\
--enable-json\
--enable-mbstring\
--with-openssl\
--enable-tokenizer\
--enable-xml\
--enable-libxml\
--enable-filter\
--enable-hash\

然后,成功安装composer

curl -sS https://getcomposer.org/installer | php
Downloading...

Composer (version 1.10.9) successfully installed to: /usr/local/php-7.2.32/ext/hash/composer.phar
Use it: php composer.phar

Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

The zlib extension is not loaded, this can slow down Composer a lot.
If possible, install it or recompile php with --with-zlib

The php.ini used by your command-line PHP is: /usr/local/etc/php/php.ini
If you can not modify the ini file, you can also run `php -d option=value` to modify ini values on the fly. You can use -d multiple times.

于是,最新版的编译参数为

./configure\
--with-libdir=/lib64\
--with-config-file-path=/usr/local/etc/php\
--with-config-file-scan-dir=/usr/local/etc/php/conf.d\
--enable-cli\
--disable-cgi\
--enable-fpm\
--with-fpm-systemd\
--with-fpm-user=nginx\
--with-fpm-group=nginx\
--enable-phar\
--with-pear\
--disable-all\
--enable-pdo\
--enable-mysqlnd\
--with-mysqli=mysqlnd\
--with-pdo-mysql=mysqlnd\
--enable-bcmath\
--enable-ctype\
--enable-fileinfo\
--enable-json\
--enable-mbstring\
--with-openssl\
--enable-tokenizer\
--enable-xml\
--enable-libxml\
--enable-filter\
--enable-hash\
--with-zlib\

然后composer global require laravel/installer报错,貌似是缺少zip
dom

xmlwriter

相关文章

  • 环境布置脚本

    Laravel框架 php-7.2.32按照Laravel官网给出的安装要求:https://laravel.co...

  • 环境布置

    回家已经四天了,适应了三天,今天开始给葫芦兄弟布置房间。 买的地垫都到了,首先给地板擦了两遍,然后把地板都铺上了地...

  • 近期linux shell脚本总结

    crontab执行脚本时是不带任何环境变量的,用sh测试正常运行的脚本在布置成crontab定时任务后不一定能正常...

  • Docker布置环境

    docker ubuntu环境里试图启sql相关的服务,提示【bash: warning: setlocale: ...

  • 复试环境布置

    如果网络复试: 1、校训制作 2、书桌布置 3、投影仪

  • 使用python脚本进行SpringBoot项目多节点上传部署

    环境搭建 脚本运行环境 安装Python3 部署脚本基于Python3实现,Python2.7无法使用该脚本,需要...

  • mac布置lnmp环境

    1.homebrew 安装nginx;版本:1.15.8;使用nginx -V 命令可以查看 各安装路径 配置...

  • 布置好学习环境

    到了培训地,住下,单人单间,真好,可以自由自在享受安静的假期了。把东西都从行李箱拿出来布置好,光记得拿香,点香的火...

  • shell脚本基础

    编写脚本 编程基础 shell脚本 创建shell脚本 变量 运算 测试 配置用户的环境

  • shell子进程修改父进程的环境变量值

    shell子进程修改父进程的环境变量值 脚本中的环境变量通过 export 导出,脚本中调用其他脚本使用这个变量 ...

网友评论

      本文标题:环境布置脚本

      本文链接:https://www.haomeiwen.com/subject/tmfkrktx.html