Skip to content

Instantly share code, notes, and snippets.

@Mashpy
Created December 7, 2023 10:53
Show Gist options
  • Save Mashpy/b88014f933d2b6736ed3d4109b874802 to your computer and use it in GitHub Desktop.
Save Mashpy/b88014f933d2b6736ed3d4109b874802 to your computer and use it in GitHub Desktop.
$ mkdir ~/php8.2.13
$ cd ~/php8.2.13
$ wget https://www.php.net/distributions/php-8.2.13.tar.gz
$ tar -xzvf php-8.2.13.tar.gz
$ cd php-8.2.13
$ ./configure --prefix=/usr/local/php8.2.13 \
--with-config-file-path=/usr/local/php8.2.13/etc \
--enable-mbstring \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-curl \
--with-mysqli \
--with-pdo-mysql \
--with-openssl \
--enable-fpm
$ make
$ sudo make install
$ sudo cp php.ini-production /usr/local/php8.2.13/etc/php.ini
$ sudo cp /usr/local/php8.2.13/etc/php-fpm.conf.default /usr/local/php8.2.13/etc/php-fpm.conf
$ sudo nano /usr/local/php8.2.13/etc/php-fpm.d/www.conf
[www]
user = www-data
group = www-data
listen = /var/run/php/php8.2.13-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
$ sudo /usr/local/php8.2.13/sbin/php-fpm -y /usr/local/php8.2.13/etc/php-fpm.conf
$ sudo update-alternatives --install /usr/bin/php php /usr/local/php8.2.13/bin/php 1
$ sudo update-alternatives --set php /usr/local/php8.2.13/bin/php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment