En este tutorial, cubriremos la instalación de php manualmente a través de comandos en el servidor CWP, es bastante fácil compilar el php desde una fuente que aumentará drásticamente el rendimiento y la estabilidad. Para compilar desde fuente / manualmente, debe seguir este tutorial paso a paso para lograr la instalación de la versión de php deseada. Lo mejor es que puede agregar sus propios indicadores de requisitos para la extensión php a la opción de configuración que, de forma predeterminada, no está presente en cwp php switcher.
Tutorial de instalación de PHP 7.3 : https://www.mysterydata.com/how-to-install-build-php-7-3-manually-on-cwp-centos-web-panel/
Este tutorial es creado a petición de nuestros visitantes.
Empecemos
Paso 1
Instala las dependencias:
yum -y instala gcc make gcc-c ++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel bzip2-devel libjpeg-devel libpng-devel freetype-devel openldap-devel postgresql-devel aspell-devel net-sncppgggggggggggggggggggggccgggggccgggggccgggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggcggggggggggg-ketel-e. libc-client-devel icu libicu-libicu-devel gmp-devel curl-devel libmcrypt-devel pcre-devel sqlite-devel db4-devel enchant-devel libXpm-devel mysql-devel readline-devel libedit-devel libio-devel libtyy -ltdl-devel
Paso 2
Instalación de php 5.6 / 7.0 / 7.1 / 7.2:
PHP 5.6
instalación de php 5.6
rm -rf / usr / local / php-5-6 mkdir -p / usr / local / php-5-6 cd / usr / local / php-5-6 wget http://php.net/distributions/php-5.6.39.tar.gz tar zxvf php-5.6.39.tar.gz cd php-5.6.39 ./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib --enable- soap --with-mysql-sock = / var / lib / mysql / mysql.sock --with-pspell --enable-wddx --with-tidy --enable-exif --enable-phar --enable-bcmath - -enable-calendar --with-curl --with-iconv --with-mysql --with-mysqli --with-mysql = mysqlnd --with-mysqli = mysqlnd --with-mcrypt --with-gettext - with-xsl --with-xmlrpc --with-pdo-mysql = mysqlnd --enable-posix --enable-ftp --with-openssl --enable-mbstring --with-kerberos --with-bz2 --enable -sockets --enable-zip --with-gd --with-jpeg-dir = / usr --with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native- ttf --with-pcre-regex --with-libdir = lib64 --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with -litespeed --with-pgsql = / usr / lib64 / pgsql --with-pdo-pgsql make && make install
Para habilitar FPM solo usa esta configuración:
./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib --enable- soap --with-mysql-sock = / var / lib / mysql / mysql.sock --with-pspell --enable-wddx --with-tidy --enable-exif --enable-phar --enable-bcmath - -enable-calendar --with-curl --with-iconv --with-mysql --with-mysqli --with-mysql = mysqlnd --with-mysqli = mysqlnd --with-mcrypt --with-gettext - with-xsl --with-xmlrpc --with-pdo-mysql = mysqlnd --enable-posix --enable-ftp --with-openssl --enable-mbstring --with-kerberos --with-bz2 --enable -sockets --enable-zip --with-gd --with-jpeg-dir = / usr --with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native- ttf --with-pcre-regex --with-libdir = lib64 --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with -litespeed --with-pgsql = / usr / lib64 / pgsql --with-pdo-pgsql --enable-fpm make && make install
PHP 7.0
instalación de php 7.0
rm -rf / usr / local / php-7-0 mkdir -p / usr / local / php-7-0 cd / usr / local / php-7-0 wget http://php.net/distributions/php-7.0.33.tar.gz tar zxvf php-7.0.33.tar.gz cd php-7.0.33 ./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-mcrypt --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr - -with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native-ttf --enable-gd-jis-conv --with-zlib-dir = / usr --with -xpm-dir = / usr --with-openssl --with-pdo-mysql = / usr --with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap - enable-phar --with-xsl --with-xmlrpc --with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = /var/lib/mysql/mysql.sock --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with -pgsql = / usr / lib64 / pgsql --with-pdo-pgsql make && make install
Para habilitar FPM solo usa esta configuración:
./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-mcrypt --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr - -with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native-ttf --enable-gd-jis-conv --with-zlib-dir = / usr --with -xpm-dir = / usr --with-openssl --with-pdo-mysql = / usr --with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap - enable-phar --with-xsl --with-xmlrpc --with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = /var/lib/mysql/mysql.sock --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with -pgsql = / usr / lib64 / pgsql --with-pdo-pgsql --enable-fpm make && make install
PHP 7.1
instalación de php 7.1
rm -rf / usr / local / php-7-1 mkdir -p / usr / local / php-7-1 cd / usr / local / php-7-1 wget http://php.net/distributions/php-7.1.25.tar.gz tar zxvf php-7.1.25.tar.gz cd php-7.1.25 ./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-mcrypt --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr - -with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native-ttf --enable-gd-jis-conv --with-zlib-dir = / usr --with -xpm-dir = / usr --with-openssl --with-pdo-mysql = / usr --with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap - enable-phar --with-xsl --with-xmlrpc --with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = /var/lib/mysql/mysql.sock --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with -pgsql = / usr / lib64 / pgsql --with-pdo-pgsql make && make install
Para habilitar FPM solo usa esta configuración:
./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-mcrypt --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr - -with-freetype-dir = / usr --with-png-dir = / usr --enable-gd-native-ttf --enable-gd-jis-conv --with-zlib-dir = / usr --with -xpm-dir = / usr --with-openssl --with-pdo-mysql = / usr --with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap - enable-phar --with-xsl --with-xmlrpc --with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = /var/lib/mysql/mysql.sock --enable-shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with -pgsql = / usr / lib64 / pgsql --with-pdo-pgsql --enable-fpm make && make install
PHP 7.2
instalación de php 7.2
rm -rf / usr / local / php-7-2 mkdir -p / usr / local / php-7-2 cd / usr / local / php-7-2 wget http://php.net/distributions/php-7.2.13.tar.gz tar zxvf php-7.2.13.tar.gz cd php-7.2.13 ./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr --with-freetype- dir = / usr --with-png-dir = / usr --enable-gd-jis-conv --with-zlib-dir = / usr --with-xpm-dir = / usr --with-openssl - con-pdo-mysql = / usr - with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap --enable-phar --with-xsl --with-xmlrpc - -with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = / var / lib / mysql / mysql.sock --enable- shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with-pgsql = / usr / lib64 / pgsql --with-pdo -pgsql make && make install
Para habilitar FPM solo usa esta configuración:
./configure --with-config-file-path = / usr / local / php --with-config-file-scan-dir = / usr / local / php / php.d --with-zlib = / usr - -enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm - -enable-wddx --with-tidy --with-curl --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir = / usr --with-freetype- dir = / usr --with-png-dir = / usr --enable-gd-jis-conv --with-zlib-dir = / usr --with-xpm-dir = / usr --with-openssl - con-pdo-mysql = / usr - with-gettext = / usr --with-bz2 = / usr --with-mysqli --enable-soap --enable-phar --with-xsl --with-xmlrpc - -with-kerberos --enable-posix --enable-sockets --with-pcre-regex --with-libdir = lib64 --with-mysql-sock = / var / lib / mysql / mysql.sock --enable- shmop --enable-intl --with-icu-dir = / usr --with-imap --with-imap-ssl --with-litespeed --with-pgsql = / usr / lib64 / pgsql --with-pdo -pgsql --enable-fpm make && make install
Paso 3
Reinicie el servidor apache y verifique la versión de php a través del comando:
servicio httpd reinicio php -v