sh install_php56.sh
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh install_php56.sh相关的知识,希望对你有一定的参考价值。
#!/bin/sh
sudo apt-get install build-essential wget nano
sudo apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libxslt1-dev
sudo ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
sudo mkdir /opt/php-5.6.30
sudo mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.6.30.tar.bz2/from/this/mirror -O php-5.6.30.tar.bz2
tar jxf php-5.6.30.tar.bz2
cd php-5.6.30/
./configure --help
./configure --prefix=/opt/php-5.6.30 --with-pdo-pgsql --with-zlib-dir --with-freetype-dir --enable-mbstring --with-libxml-dir=/usr --enable-soap --enable-calendar --with-curl --with-mcrypt --with-zlib --with-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-pdo-mysql --with-mysqli --with-jpeg-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-gettext --with-xmlrpc --with-xsl --with-kerberos --enable-fpm
make
make install
sudo cp /usr/local/src/php5-build/php-5.6.30/php.ini-production /opt/php-5.6.30/lib/php.ini
sudo cp /opt/php-5.6.30/etc/php-fpm.conf.default /opt/php-5.6.30/etc/php-fpm.conf
sudo mkdir /opt/php-5.6.30/etc/php-fpm.d
sudo cat >> /opt/php-5.6.30/etc/php-fpm.conf << EOF
pid = run/php-fpm.pid
user = www-data
group = www-data
listen = 127.0.0.1:8999
include=/opt/php-5.6.30/etc/php-fpm.d/*.conf
EOF
cd /opt/php-5.6.30/etc
sudo pecl -C ./pear.conf update-channels
sudo pecl -C ./pear.conf install xdebug
sudo cat >> /opt/php-5.6.30/lib/php.ini << EOF
zend_extension=/opt/php-5.6.30/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
EOF
sudo cat >> /lib/systemd/system/php-5.6.30-fpm.service << EOF
[Unit]
Description=The PHP 5.6 FastCGI Process Manager
After=network.target
[Service]
Type=simple
PIDFile=/opt/php-5.6.30/var/run/php-fpm.pid
ExecStart=/opt/php-5.6.30/sbin/php-fpm --nodaemonize --fpm-config /opt/php-5.6.30/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable php-5.6.30-fpm.service
sudo systemctl daemon-reload
sudo systemctl start php-5.6.30-fpm.service
sudo cat >> /opt/php-5.6.30/lib/php.ini << EOF
zend_extension=opcache.so
EOF
cd /opt/php-5.6.30/bin
sudo ./php --version
以上是关于sh install_php56.sh的主要内容,如果未能解决你的问题,请参考以下文章