mkdir bullten
cd bullten
wget http://am1.php.net/distributions/php-7.2.4.tar.gz
tar zxvf php-7.2.4.tar.gz
cd php-7.2.4
./configure --with-bz2 \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-curl \
--with-libdir=/usr/lib64 \
--with-config-file-path=/usr/local/php \
--with-config-file-scan-dir=/usr/local/php/php.d \
--with-iconv \
--with-gd \
--with-jpeg-dir=/usr/local/php \
--with-png-dir \
--with-freetype-dir=/usr/local/php \
--with-kerberos \
--enable-fpm \
--enable-mbstring \
--with-mhash \
--with-mysqli \
--with-sqlite3 \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-xsl \
--with-pspell \
--with-openssl \
--with-gettext \
--with-pcre-regex \
--with-libxml-dir=/usr/local/php \
--with-pdo-mysql \
--with-pic \
--with-pear=/usr/local/php/pear \
--with-gmp \
--enable-zip \
--with-zlib \
--enable-inline-optimization \
--enable-mbregex \
--enable-opcache \
--enable-fpm \
--enable-posix \
--enable-calendar \
--enable-bcmath \
--enable-exif \
--enable-phar \
--enable-ftp \
--enable-pdo \
--enable-soap \
--enable-sockets \
--enable-intl \
--with-xmlrpc \
--without-pdo-sqlite
make && make install
rm -rf /usr/local/php/php.d/ioncube.ini
rm -rf /usr/local/php/php.ini
cp php.ini-production /usr/local/php/php.ini
rm -rf /usr/local/bin/php
ln -s /usr/local/php/bin/php /usr/local/bin/php
cp /root/bullten/php-7.2.4/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
nano php-fpm.conf
uncomment below lines
pid = run/php-fpm.pid
error_log = log/php-fpm.log
cd php-fpm.d
cp www.conf.default yourdomain.com.conf
nano yourdomain.com.conf
change to yourusername and edit other lines as needed.
user = yourusername
group = yourusername
mkdir -p /usr/local/php/log/
edit your vhost file and add the below lines just below scripalias
<LocationMatch "^/(.*\.php(/.*)?)$">
ProxyPass fcgi://127.0.0.1:9000/home/yourusername/public_html/$1
</LocationMatch>
nano /usr/local/apache/conf/httpd.conf
uncomment the below line
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
service php-fpm start
service php-fpm restart
service php-fpm status
service php-fpm stop