Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Package versions
- # PHP version to install
- phpver=5.4.21
- #APC extension version to install
- apcver=3.1.13
- # Imagick extension version to install
- imagickver=3.1.2
- # Install PHP/FPM
- mkdir -p /home/${USER}/src/php
- cd ~/src/php
- wget http://us2.php.net/get/php-${phpver}.tar.gz/from/this/mirror
- tar xvf php-${phpver}.tar.gz
- cd php-${phpver}
- ./configure \
- --enable-fpm \
- --enable-intl \
- --with-curl=/usr \
- --with-mysql \
- --with-mysqli \
- --with-pdo-mysql \
- --with-gd \
- --with-jpeg-dir=/usr/lib64/ \
- --with-png-dir=/usr/lib64/ \
- --with-freetype-dir=/usr/include/freetype2/ \
- --with-zlib-dir=/usr/include/ \
- --enable-mbstring \
- --with-libdir=lib64 \
- --prefix=$HOME/php5.4 \
- --with-config-file-scan-dir=$HOME/php5.4/etc/conf.d
- make && make install
- # Configure PHP-FPM
- cp /home/${USER}/php5.4/etc/php-fpm.conf.default /home/${USER}/php5.4/etc/php-fpm.conf
- echo "
- [global]
- pid = /home/${USER}/php5.4/var/run/php-fpm.pid
- emergency_restart_threshold = 10
- emergency_restart_interval = 1m
- process_control_timeout = 10s
- [www]
- listen = /home/${USER}/php5.4/var/run/php5-fpm.sock
- pm = dynamic
- pm.max_children = 8
- pm.start_servers = 2
- pm.min_spare_servers = 1
- pm.max_spare_servers = 3
- " > /home/${USER}/php5.4/etc/php-fpm.conf
- echo "
- date.timezone = \"UTC\"
- " > /home/${USER}/php5.4/lib/php.ini
- mkdir -p /home/${USER}/php5.4/etc/conf.d
- # Install extensions
- cd ~/src/php
- wget http://pecl.php.net/get/APC-${apcver}.tgz
- tar xvf APC-${apcver}.tgz
- cd APC-${apcver}
- ~/php5.4/bin/phpize
- ./configure --enable-apc --with-php-config=$HOME/php5.4/bin/php-config
- make && make install
- cp apc.php /home/${USER}/nginx/html/apc.php
- echo "
- extension=apc.so
- ;Cache size
- apc.shm_size = 128M
- ;Total amount of estimated cachable objects on server.
- ;Source files and user entries respectively
- apc.num_files_hint = 0
- apc.user_entries_hint = 0
- ;The number of seconds a cache entry is allowed to
- ;idle in a slot before APC dumps the cache
- apc.ttl = 0
- apc.user_ttl = 0
- apc.gc_ttl = 3600
- ;MUST be set to 1 when cachable files are being updated.
- ;Only enable after server is stable and ready for
- ;long running without file system changes
- apc.stat = 1
- ;Cache slam protection bug fix
- apc.write_lock = 1
- apc.slam_defense = 0
- " > /home/${USER}/php5.4/etc/conf.d/apc.ini
- cd ~/src/php
- wget http://pecl.php.net/get/imagick-${imagickver}.tgz
- tar xzvf imagick-${imagickver}.tgz
- cd imagick-${imagickver}
- phpize54
- ./configure --with-php-config=/home/${USER}/php5.4/bin/php-config
- make && make install
- echo "extension = imagick.so" >> /home/${USER}/php5.4/lib/php.ini
- # Start server
- ~/php5.4/sbin/php-fpm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement