Pertama perlu ketahui disini kita akan mengcompile PHP dari source, tidak menggunakan yum sebagai alat instalasi.
Langkah :

  • Masuk ke SSH akses root vps
  • Download PHP 7.4 di https://www.php.net/download
  • Ekstrak file
  • Masuk direktori
  • Atur konfigurasi seperti di bawah :

./configure \ --prefix=/usr/local/apps/php74 \ --with-config-file-path=/usr/local/apps/php74/etc \ --with-apxs2=/usr/local/apps/apache2/bin/apxs \ --enable-mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-pdo \ --with-iconv-dir \ --with-freetype \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-kerberos \ --with-libxml-dir= \ --enable-xml \ --enable-session \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --enable-mbregex \ --enable-mbstring \ --enable-intl \ --enable-pcntl \ --enable-ftp \ --with-gd \ --with-openssl \ --with-mhash \ --enable-sockets \ --with-xmlrpc \ --enable-soap \ --with-gettext \ --disable-fileinfo \ --with-xsl \ --enable-tokenizer \ --enable-inline-optimization \ --enable-fastcgi \ --enable-cli \ --enable-cgi \ --enable-force-cgi-redirect \ --enable-fpm \ --with-mime-magic \ --enable-fileinfo \ --enable-imap \ --with-imap \ --with-imap-ssl \ --enable-json \ --with-pdf=shared \ --enable-phar \ --enable-mailparse \ --with-xml \ --enable-xmlreader \ --enable-xmlwriter \ --with-simplexml \ --with-ncurses \ --enable-inline-optimization \ --enable-fastcgi \ --enable-cgi \ --enable-fileinfo \ --enable-mbstr-enc-trans \ --enable-mbregex \ --enable-mbregex-backtrack \ --with-icu-dir \ --with-ssh2=shared,/usr/local/apps \ --with-pkgconfigdir=/usr/local/apps/lib/pkgconfig \ --enable-ctype \ --enable-calendar \ --enable-dom \ --enable-mcrypt \ --enable-fileinfo \ --enable-phar \ --with-pear \ --enable-bcmath \ --with-bz2 \ --with-calendar \ --with-pcre-regex \ --with-pcre-jit \ --with-mcrypt \ --enable-exif \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --with-webp-dir \ --with-png-dir \ --includedir=/usr/local/apps/php74/include \ --disable-debug \ --enable-discard-path \ --enable-filepro \ --enable-ipv6 \ --enable-path-info-check \ --enable-magic-quotes \ --enable-track-vars \ --enable-trans-sid \ --enable-yp \ --enable-zts \ --with-libdir=lib64 \ --with-tidy \ --with-zip \ --enable-gd \ --enable-gd-imgstrttf \ --enable-gd-native-ttf \ --with-gmp \ --enable-xslt \ --enable-dba \ --enable-dbase=shared \ --with-fdf=shared \ --enable-dbx=shared

Lalu

  • make -j4 && make install

Selesai.