如何编写一个高效安装php7的shell脚本?
- 内容介绍
- 文章标签
- 相关推荐
本文共计287个文字,预计阅读时间需要2分钟。
PHP 7.2.0 版本于 2015 年 12 月正式发布,相比 5.6 版本,性能提升了不少。为了测试 PHP7,可以在 php.ini 配置文件中添加以下设置:zend_extension=opcache.so、opcache.enable=1、opcache.enable_cli=1。这样设置后,性能可以得到显著提升。
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
果然性能提高了很多。
#!/bin/bash apt-get update apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev libicu-dev build-essential mkdir -p /usr/local/php7/etc/conf.d mkdir /usr/local/php7 cd /tmp git clone git.php.net/repository/php-src.git --depth=1 cd php-src ./buildconf ./configure --prefix=/usr/local/php7 --enable-intl --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-bcmath --with-bz2 --enable-exif --enable-dba --enable-ftp --with-gettext --with-gd --enable-mbstring --with-mcrypt --with-mhash --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-pcntl --with-pspell --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-zlib --enable-zip --with-readline --with-curl --with-config-file-path=/usr/local/php7/etc --with-config-file-scan-dir=/usr/local/php7/etc/conf.d make make install
本文共计287个文字,预计阅读时间需要2分钟。
PHP 7.2.0 版本于 2015 年 12 月正式发布,相比 5.6 版本,性能提升了不少。为了测试 PHP7,可以在 php.ini 配置文件中添加以下设置:zend_extension=opcache.so、opcache.enable=1、opcache.enable_cli=1。这样设置后,性能可以得到显著提升。
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
果然性能提高了很多。
#!/bin/bash apt-get update apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev libicu-dev build-essential mkdir -p /usr/local/php7/etc/conf.d mkdir /usr/local/php7 cd /tmp git clone git.php.net/repository/php-src.git --depth=1 cd php-src ./buildconf ./configure --prefix=/usr/local/php7 --enable-intl --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-bcmath --with-bz2 --enable-exif --enable-dba --enable-ftp --with-gettext --with-gd --enable-mbstring --with-mcrypt --with-mhash --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-pcntl --with-pspell --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-zlib --enable-zip --with-readline --with-curl --with-config-file-path=/usr/local/php7/etc --with-config-file-scan-dir=/usr/local/php7/etc/conf.d make make install

