Setup PHP FPM
Contents
Run the following commands to install PHP FPM:
apt-get install php5-fpm php5-cli php-apc php5-suhosin php5-curl php5-gd php5-intl php5-mcrypt php-gettext php5-mysql php5-sqlite
After the installation completed, we’re going to customize it. But first, let’s backup the config files.
mkdir /root/backup mkdir /root/backup/etc mkdir /root/backup/etc/php5 mkdir /root/backup/etc/php5/conf.d mkdir /root/backup/etc/php5/fpm mkdir /root/backup/etc/php5/fpm/pool.d cp /etc/php5/conf.d/apc.ini /root/backup/etc/php5/conf.d cp /etc/php5/fpm/php.ini /root/backup/etc/php5/fpm cp /etc/php5/fpm/pool.d/www.conf /root/backup/etc/php5/fpm/pool.d
Now let’s modify /etc/php5/conf.d/apc.ini. Replace its content with:
[APC] extension=apc.so apc.enabled=1 apc.shm_segments=1 apc.shm_size=16 apc.ttl=7200 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.max_file_size = 1M apc.post_max_size = 1000M apc.upload_max_filesize = 1000M apc.enable_cli=0 apc.rfc1867=0
Next, let’s modify /etc/php5/fpm/php.ini. Append the following text:
[apc] apc.write_lock = 1 apc.slam_defense = 0
Lastly, let’s modify /etc/php5/fpm/pool.d/www.conf. Match the content with below configuration:
user = nginx group = nginx listen = /dev/shm/php-fpm-www.sock listen.owner = nginx listen.group = nginx listen.mode = 0666
Let’s now restart the service
service php5-fpm restart
loading...
About Hardono
Incoming Search
linux, nginx, ubuntu, wordpress