Compile Installation
Differences and future choices between PHP source compilation and installation via yum under Centos8
Actually, each of these two methods has its own advantages:
yum installation:
From the perspective of Yum installation, Yum is equivalent to automatic help you install, regardless of the software dependencies, the yum installation process is to help you solve all the software dependencies for you foolishly.The service startup of Centos7 is now controlled by the systemctl command.The Yum installation will help you automatically register the service. You can start the service via systemctl start xxx.service, which is convenient and quick.However, the disadvantage is that you cannot interfere with the yum installation, and the installed directories are scattered.You may want to execute the whereis or find command to find the path to the yum installation.Sometimes the software version installed by Yum is lower and you have to go to another Yum source or rpm package.
Source installation:
Source code compilation can solve a lot of dependency problems during the installation process in order to install a software.You cannot start the service with systemctl because there is no configuration file for your service under / usr/lib/systemd/system/path and you have to write one yourself.But the advantage is that you can choose the version of the software, customize the installation directory, and install the modules.More flexibility and convenience.
LNMP One-Click Installation:
All three of the above have their own advantages. It is recommended that beginners must master the process of source code compilation, solve the problems encountered in the installation manually, and be familiar with how to compile a software, which is beneficial for the future development, and some software can not be installed through yum. Source code compilation is very important at this time.For software like PHP, if it is compiled and installed, you have to compile PHP extensions in phpize,. /configure, make && make install, etc. without an extension, which is tedious.If you install with yum, when you add an extension, such as pdo, you can yum search php | grep pdo to find the right PDO package, and then download the installation, which will automatically add you to the list of PHP extensions.Much of our work has been omitted.LNMP One-Click Installation is used for developers to quickly set up their development environment, allowing them more time to develop their business logic.
1. Use the yum command ( Learn the basic knowledge of yum)
Reference website:
# https://www.jb51.net/article/175918.htm # https://www.itgeeker.net/php7-3-yum-install-on-centos-7/
This is a simpler way to install php quickly and easily.( Basic usage and examples of rpm commands)
#Add several sources or errors will occur #php Higher version yum The source address, which has two parts, is epel-release,The other part comes from webtatic. If skipped epel-release If so, install webtatic When rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-8.rpm
After adding the related libraries, enable the Remi module for PHP 7.4 and install it.
dnf -y install dnf-utils
#Use this command to view php7.4 yum search php74*
Then install the module you want:
php74: install PHP 7.4 Package for php74-php: Used to create dynamics web Of PHP Scripting Language Website php74-build: Basic build configuration php74-php-gd: Be used for PHP Application Use gd Module Graphics Library php74-xhprof: One for PHP - Web Hierarchical parser for interfaces php74-zephir: Used to create extensions Zephir language PHP: php74-php-ast: Abstract Grammar Tree php74-php-cli: Be used for PHP The command line interface of php74-php-dba: One for PHP Database Abstraction Layer Module Application php74-php-dbg: interactive PHP debugger php74-php-ffi: External Function Interface php74-php-fpm: PHP FastCGI Process Manager php74-php-gmp: One for use GNU Of PHP Application Module Member Library php74-php-lz4: x86_64: PHP Of LZ4 extend php74-php-pdo: One for PHP Database Access Abstract Module Application php74-php-xml: x86_64:For use with XML Of PHP Modules of the application php74-runtime: Handle php74 Packages of the software collection: php74-php-imap: x86_64:For use with IMAP Of PHP Modules of the application php74-php-intl: x86_64: PHP Internationalized Extended Applications php74-php-json: x86_64: PHP Of JavaScript Object Symbol Extension php74-php-ldap: x86_64:For use with LDAP Of PHP Modules of the application php74-php-oci8: x86_64:For use with OCI8 Of PHP Application's module database php74-php-odbc: x86_64:For use with ODBC Of PHP Application's module database php74-php-pear: noarch: PHP Extensions and Application Library Framework php74-php-pggi: GTK binding php74-php-snmp: One for PHP Modules for application queries SNMP-managed equipment php74-php-soap: For use with SOAP Of PHP Module Protocol for Applications php74-php-tidy: standard PHP Module provided tidy Library support php74-php-zstd: x86_64: Zstandard Extension php74-scldevel: x86_64:Pack php74 Development documents php74-unit-php: Be used for NGINX Unital PHP Modular php74-php-devel: structure PHP Expand required files php74-php-pgsql: One for PHP Of PostgreSQL Database module php74-php-pinba: x86_64: Pinba Client Extension for Statistics Server php74-php-bcmath: Be used for PHP Modules of the application bcmath library php74-php-brotli: Be used for PHP Of Brotli extend php74-php-common: PHP Public Documents php74-php-pspell: x86_64:Be used for PHP Interface in Module of Application php74-php-recode: Be used for PHP Module Recoding Library for Applications php74-php-snappy: PHP Of Snappy extend php74-php-sodium: x86_64:Packaging of Sodium Cryptographic Library php74-php-sqlsrv: x86_64:Be used for SQL Server Of PHP Microsoft Driver php74-php-xmlrpc: Of PHP Application module xml - rpc Agreement php74-php-enchant: Enhance PHP Spelling extension application for php74-php-libvirt: Be used for Libvirt Of PHP Language Binding php74-php-mysqlnd: x86_64:For use with MySQL Of PHP Application's module database php74-php-opcache: x86_64: Zend OPcache php74-php-pecl-ds: x86_64: PHP Data structure php74-php-pecl-ev: provide libev Library's interface php74-php-pecl-pq: PostgreSQL Client Library(libpq)binding php74-php-pecl-uv: Libuv Packer php74-php-process: Be used for PHP Script modules use system process interfaces php74-php-embedded: For embedding applications PHP library php74-php-mbstring: One for PHP Module Multi-byte String Processing for Applications php74-php-pecl-dio: direct I/O function php74-php-pecl-eio: provide libeio Library's interface php74-php-pecl-env: Loading environment variables php74-php-pecl-lua: Embedded lua interpreter php74-php-pecl-lzf: x86_64:Handle LZF de/Compressed Extension php74-php-pecl-nsq: NSQ Client's PHP extend php74-php-pecl-psr: PSR Interface php74-php-pecl-rar: For reading RAR Archived PHP extend php74-php-pecl-rrd: x86_64: rrdtool Of PHP binding php74-php-pecl-sdl: Ordinary PHP DirectMedia layer php74-php-pecl-svn: x86_64: Subversion Version of PHP Binding Control System php74-php-pecl-vld: x86_64:dump PHP Internal Representation Script php74-php-pecl-yac: Unlocked User Data Cache php74-php-pecl-yaf: x86_64:Another Framework php74-php-pecl-yar: lightweight concurrency RPC frame php74-php-pecl-yaz: x86_64: Z39.50/SRU Client php74-php-pecl-zip: One ZIP File extension php74-php-pecl-zmq: ZeroMQ message passing php74-php-phalcon4: Phalcon frame php74-php-componere: Write at runtime PHP class php74-php-litespeed: LiteSpeed Web The server PHP Support php74-php-maxminddb: MaxMind DB Reader extend php74-php-pdo-dblib: x86_64: PDO Driver, for Microsoft SQL Server and Sybase data base php74-php-pecl-amqp: With any AMQP Compatible Server Communication php74-php-pecl-apcu: APC User Cache php74-php-pecl-apfd: Always fill in form data php74-php-pecl-fann: Be used for FANN Packager for Library php74-php-pecl-grpc: x86_64:currency RPC frame php74-php-pecl-http: Extended HTTP Support php74-php-pecl-krb5: Kerberos Validation Extensions php74-php-pecl-pcov: x86_64:Code Override Driver php74-php-pecl-ssh2: x86_64: libssh2 Binding of Libraries php74-php-pecl-sync: Named and unnamed synchronization objects php74-php-pecl-uopz: x86_64: Zend User Action php74-php-pecl-uuid: Universal Unique Identifier Extension For PHP php74-php-pecl-vips: x86_64:and libvip Interface PHP extend php74-php-pecl-wddx: Web Distributed Data Exchange php74-php-pecl-yaml: x86_64: yaml Of PHP binding php74-php-phpiredis: x86_64: Redis Client extension php74-php-smbclient: libsmbclient Of PHP Packing php74-php-wkhtmltox: HTML Converter php74-php-pecl-cmark: CommonMark Extension php74-php-pecl-dbase: dBase Database File Access Functions php74-php-pecl-druid: One PHP Druid Driver for php74-php-pecl-event: provide libevent Library's interface php74-php-pecl-geoip: take IP Geographic location of the extension to which the address is mapped php74-php-pecl-gnupg: x86_64: gpgme Packaging of Library php74-php-pecl-mysql: MySQL Database Access Functions php74-php-pecl-oauth: PHP OAuth Consumer Expansion php74-php-pecl-parle: x86_64:Parsing and Lexical Analysis php74-php-pecl-raphf: Resource and Persistent Handle Factory php74-php-pecl-solr2: Apache Solr Of API Oriented Objects php74-php-pecl-stats: Routines for statistical calculations php74-php-pecl-stomp: Stomp Client Extension php74-php-pecl-taint: x86_64: XSS Code sniffer php74-php-pecl-xattr: Extended Properties php74-php-pecl-xdiff: File Differences/patch php74-php-pecl-xxtea: XXTEA Encryption algorithm extension PHP php74-php-libvirt-doc: noarch: php-libvirt file php74-php-pecl-base58: use base58 Encoding and decoding data php74-php-pecl-bitset: Bit Set Library php74-php-pecl-crypto: OpenSSL Wrapper for password Libraries php74-php-pecl-gender: x86_64:Gender Expansion php74-php-pecl-hprose: Be used for PHP Of h Prose php74-php-pecl-hrtime: x86_64:High resolution timing php74-php-pecl-mcrypt: x86_64: libmcrypt Binding of Libraries php74-php-pecl-pdflib: generate PDF Package of files php74-php-pecl-propro: Property Agent php74-php-pecl-radius: Radius Client Library php74-php-pecl-redis4: Extensions Redis Key Value Storage php74-php-pecl-redis5: Extensions Redis Key Value Storage php74-php-pecl-scrypt: Scrypt Hash function php74-php-pecl-sphinx: Sphinx SQL Full-text PECL Extended Search Engine php74-php-pecl-ssdeep: libfuzzy Packager for Library php74-php-pecl-trader: Provide technical analysis for traders php74-php-pecl-xdebug: For debugging PHP Scripted PECL package php74-php-pecl-xhprof: x86_64: XHProf Of PHP Extension, Hierarchy Analyzer php74-php-pecl-yaconf: x86_64:Another Configuration Container php74-php-pecl-apcu-bc: APCu Backward compatibility module php74-php-pecl-decimal: Any precision floating-point decimal php74-php-pecl-gearman: PHP Packager to libgearman php74-php-pecl-gmagick: Wrapper for GraphicsMagick library php74-php-pecl-imagick: x86_64:Extended use for creating and modifying images ImageMagick php74-php-pecl-inotify: x86_64: Inotify php74-php-pecl-leveldb: LevelDB PHP binding php74-php-pecl-memprof: x86_64:Memory Usage Analyzer php74-php-pecl-mongodb: x86_64:Be used for PHP Of MongoDB Driver php74-php-pecl-msgpack: Used with MessagePack Communicating API serialize php74-php-pecl-rdkafka: Be based on librdkafka Of Kafka Client php74-php-pecl-rpminfo: x86_64: RPM information php74-php-pecl-runkit7: For these you...Should not...I've been doing it anyway...But certainly! php74-php-pecl-seaslog: An effective, fast, and stable log PHP extend php74-php-pecl-selinux: Be used for PHP Scripted SELinux Binding Language php74-php-pecl-swoole4: PHP Asynchronous Concurrent Distributed Network Framework for php74-php-pecl-timecop: x86_64:Time travel and freeze expansion php74-php-pecl-varnish: Varnish Cache Binding php74-php-pecl-xmldiff: x86_64: XML Differences and Merges php74-php-pecl-igbinary: x86_64:Substitution Criteria PHP Serializer php74-php-pecl-memcache: x86_64:Use Memcached Extended Cache Daemon php74-php-pecl-mogilefs: To communicate with PHP Client Library MogileFS storage php74-php-pecl-mustache: Mustache Template Language php74-php-pecl-protobuf: Serialize structured mechanism data php74-php-pecl-rdkafka4: Be based on librdkafka Of Kafka Client php74-php-pecl-scoutapm: Local Extension Components ScoutAPM Of PHP agent php74-php-pecl-translit: Set Transliteration of Non-Latin Characters to Latin php74-php-snuffleupagus: x86_64: PHP Security module php74-php-zephir-parser: x86_64: Zephir Parser Extension php74-php-pecl-cassandra: Be used for Apache Of DataStax PHP Driver Cassandra php74-php-pecl-json-post: JSON POST processing program php74-php-pecl-mailparse: For resolving sums PHP PECL Package Processing E-mail Messages php74-php-pecl-memcached: x86_64:Use Memcached Extended Cache Daemon php74-php-pecl-mosquitto: libmosquito - to Extension php74-php-pecl-seasclick: One Yandex ClickHouse Client Driver PHP extend php74-php-pecl-xlswriter: An efficient, fast xlsx File export extension php74-php-horde-horde-lz4: Horde LZ4 Compression Expansion php74-php-pecl-apcu-devel: APCu Developer Files(header file) php74-php-pecl-couchbase2: Couchbase The server PHP extend php74-php-pecl-geospatial: PHP Extend to handle public geospatial functionality php74-php-pecl-handlebars: Handlebars Template Language php74-php-pecl-http-devel: x86_64:extend HTTP Support Developer Files(head) php74-php-pecl-krb5-devel: Kerberos Extend Developer Files(head) php74-php-pecl-luasandbox: With restrictions and security Lua Interpreter environment php74-php-pecl-opencensus: One stats Collection and Distributed Tracking Framework php74-php-pecl-skywalking: x86_64: Apache Of PHP Tool agent footbridge php74-php-pecl-ahocorasick: Effective Aho-Corasick String pattern matching algorithm php74-php-pecl-ip2location: Obtain an Geographic location information IP address php74-php-pecl-http-message: x86_64: PSR-7 HTTP Message implementation php74-php-pecl-datadog-trace: APM And distributed tracking PHP php74-php-pecl-hdr-histogram: x86_64: C Language PHP Expanded Packaging hdrhistogram API php74-php-pecl-imagick-devel: imagick Extend Developer Files(head) php74-php-pecl-msgpack-devel: MessagePack Developer Files(head) php74-php-pecl-mysql-xdevapi: MySQL Database Access Functions php74-php-pecl-mysqlnd-azure: x86_64: mysqlnd Redirectional Plugin php74-php-pecl-igbinary-devel: Igbinary Developer Files(head) php74-php-pecl-uploadprogress: x86_64:Extended file upload to track progress
# Run once yum install php74-php
Install additional packages using the following commands
yum search php74*
yum install php74-xxx
Run and view versions, restart commands, add autostart, link php files
#Run and view versions
php74 -v
#Restart Command php-fpm systemctl restart php74-php-fpm
#Add Autostart systemctl enable php74-php-fpm
#View the installation path for php7.4
whereis php #link php file ln -s /opt/remi/php74/root/usr/bin/php /usr/bin/php
Paths to some profiles
# The current PHP memory limit is below the recommended value of 512MB. vi /etc/opt/remi/php74/php.ini memory_limit = 512M #If you are running nginx Instead of apache,modify vi /etc/opt/remi/php74/php-fpm.d/www.conf user = apache group = apache # Replace the values with user = nginx group = nginx
Uninstall all php7.4
yum remove php74-php*
2. Compile and install PHP and the basic extension libraries needed (php7.4)
Reference website:
https://www.php.net/manual/zh/install.php
https://www.cnblogs.com/werben/p/11833903.html
https://www.cnblogs.com/ckh2014/p/10909672.html
https://www.24kplus.com/linux/1614.html
Download php source
With php's official website, there are many sources, which version you want to select yourself
https://www.php.net/distributions/php-7.4.2.tar.bz2
#Back to User Directory cd ~ #download php7.4 Source code wget https://www.php.net/distributions/php-7.4.2.tar.bz2
Download complete
Basic commands and examples for decompressing text
# Move it to usr/local File operation, my personal habits mv php-7.4.2.tar.bz2 /usr/local/php-7.4.2.tar.bz2
# Switch File Directory
cd /usr/local/ # Unzip File tar --bzip -xvf /usr/local/php-7.4.2.tar.bz2
# Switch File Directory
cd php-7.4.2
Install compilation tools and libraries
Install php's dependent libraries and install compiled tools, either installed or not
yum -y install gcc gcc-c++
yum -y install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel libicu-devel freetype-devel openldap-devel openldap openldap-devel
Create user groups and users
groupadd www
useradd -g www www
Some parameters and significance of PHP. /configure
Meaning of PHP compilation parameters ./configure - prefix=/usr/local/php PHP installation directory –with-apxs2=/usr/local/apache/bin/apxs - with-config-file-path=/usr/local/php/etc Specifies php.ini location - with-MySQL=/usr/local/mysql MySQL installation directory, support for MySQL - with-mysqli=/usr/local/mysql/bin/mysql_config mysqli file directory, optimization support - enable-safe-mode turns on security mode - enable-ftp opens FTP support - enable-zip opens support for zip - with-bz2 to open support for bz2 files - with-jpeg-dir opens support for JPEG pictures - with-png-dir opens support for PNG pictures - with-freetype-dir opens support for freetype font Libraries - without-iconv closes the iconv function, converting between character sets - with-libxml-dir to open support for libxml2 Libraries - with-xml RPC opens the C language of xml-rpc - with-zlib-dir support for opening zlib Libraries - support for opening GD libraries with-gd - enable-gd-native-ttf supports the TrueType string function library - with-curl Open support for curl browsing tools - with-curlwrappers uses curl tools to open url streams - with-ttf opens support for freetype1. * without adding - with-xsl opens XSLT file support, extends libxml2 library, requires libxslt software - with-gettext Open gnu's gettexts support, used by the encoding Library - with-pear opens support for the pear command, which is used by php extensions - enable-calendar opens calendar extension - enable-mbstring multi-byte, string support - enable-bcmath turns on picture resizing, this module is used for zabbix monitoring - enable-sockets turn on sockets support - Metadata support for enable-exif pictures - Support for enable-magic-quotes magic references - disable-rpath closes additional runtime files - disable-debug turns off debugging mode - with-mime-magic=/usr/share/file/magic.mime magic header file location Parameters for cgi installation - enable-fpm php-fpm patch before this parameter, cgi installed startup program - enable-fastcgi supports fastcgi way to start php - enable-force-cgi-redirect Same as above, no explanation in the help - with-ncurses Dynamic Library that supports ncurses screen drawing and graphical interaction based on text terminals - enable-pcntl free TDS is required, probably by linking mssql Extensions to mhash and mcrypt algorithms - with-mcrypt algorithm - with-mhash algorithm –with-gmp –enable-inline-optimization - with-openssl OpenSSL support for encrypted transmissions –enable-dbase - with-pcre-dir=/usr/local/bin/pcre-config Perl regular library installation location –disable-dmalloc - with-gdbm dba's gdbm support –enable-sigchild –enable-sysvsem –enable-sysvshm - enable-zend-multibyte supports zend's multibytes –enable-mbregex –enable-wddx –enable-shmop –enable-soap Complete list of PHP configuration options Database Options --with-dbplus Includes support for dbplus. --with-adabas[=DIR]] Includes support for Adabas D.DIR is the basic installation directory for Adabas, defaulting to /usr/local. --with-sapdb[=DIR]] Includes support for SAP DB.DIR is the basic installation directory for SAP DB, defaulting to /usr/local. --with-solid[=DIR]] Includes Solid support.DIR is Solid's basic installation directory, defaulting to/usr/local/solid. --with-ibm-db2[=DIR]] Includes IBM DB2 support.DIR is the basic installation directory for DB2, defaulting to / home/db2inst1/sqllib. --with-empress[=DIR]] Includes support for Empress.DIR is the basic installation directory for Empress and defaults to $EMPRESSPATH.Beginning with PHP4, this option only supports Empress 8.60 and above. --with-empress-bcs[=DIR]] Includes support for Empress Local Access.DIR is the basic installation directory for Empress and defaults to $EMPRESSPATH.Beginning with PHP4, this option only supports Empress 8.60 and above. --with-birdstep[=DIR]] Includes support for Birdstep.DIR is the basic installation directory for Birdstep, defaulting to /usr/local/birdstep. --with-custom-odbc[=DIR]] Includes support for user-defined ODBC.DIR is the basic installation directory of ODBC, defaulting to / usr/local.To confirm that CUSTOM_ODBC_LIBS is defined and that there is an odbc.h in the include directory.For example, for Sybase SQLAnywhere 5.5.00 under QNX, the following environment variables should be defined before running the configure script: CPPFLAGS="-DODBC_QNX-DSQLANY_BUG" LDFLAGS=-lunix CUSTOM_ODBC_LIBS="-ldblib-lodbc". --with-iodbc[=DIR]] Includes iODBC support.DIR is the basic installation directory of iODBC, defaulting to / usr/local. --with-esoob[=DIR]] Includes support for Easysoft OOB.DIR is the basic installation directory of OOB, defaulting to / usr/local/easysoft/oob/client. --with-unixODBC[=DIR]] Includes support for unixODBC.DIR is the basic installation directory for unixODBC, defaulting to /usr/local. --with-openlink[=DIR]] Includes support for OpenLink ODBC.DIR is the basic installation directory for OpenLink and defaults to / usr/local.This is the same as iODBC. --with-dbmaker[=DIR]] Includes support for DBMaker.DIR is the basic installation directory for DBMaker and defaults to the directory installed for the latest version of DBMaker (for example, /home/dbmaker/3.6). --disable-unified-odbc Remove support for unified ODBC.Applicable only to activated iODBC, Adabas, Solid, Velocis or user-defined ODBC interfaces.Only for PHP 3! Image Options --without-gd. Disable GD support.For PHP 3 only! --with-imagick The Imagick extension has been moved to PECL in PEAR and can be found here.Installation instructions in PHP 4 can be found at the PEAR site.Only--with-imagick is supported in PHP 3 unless you follow the instructions of the PEAR site. --with-ming[=DIR]] Includes min support. Miscellaneous Options --enable-force-cgi-redirect Activates security checks for internal redirections within the server.This option should be used if PHP is used CGI in Apache. --enable-discard-path This option allows PHP's CGI executables to be safely placed outside the web directory tree, and no one else can bypass the security settings for.htaccess. --with-fastcgi Compiles PHP into a FastCGI application. --enable-debug Add debug symbols at compile time. --with-layout=TYPE) Sets the file layout after installation.TYPE can be PHP (default) or GNU. --with-pear=DIR. Install PEAR in the DIR directory (default is PREFIX/lib/php). --without-pear. PEAR is not installed. --enable-sigchild Activate PHP's own SIGCHILD handle. --disable-rpath -- Disables the delivery of additional runtime library search paths. --enable-libgcc] Activate an explicit libgcc connection. --enable-php-streams -- PHP stream containing tests.Do not use unless you are testing the source code! --with-zlib-dir=<DIR> Defines the installation path for zlib. --with-aspell[=DIR]] Contains ASPELL support. --with-ccvs[=DIR]] Contains CCVS support. --with-cybercash[=DIR]] Contains CyberCash support.DIR is the installation directory of CyberCash MCK. --with-icap[=DIR]] Contains ICAP support. --with-ircg-config The path to the ircg-config script. --with-ircg Contains ircg support. --enable-mailparse Contains mailparse support. --with-muscat[=DIR]] Includes Muscat support. --with-satellite[=DIR]] Activates CORBA support through Satellite (experimental nature).DIR is the ORBit home directory. --enable-trans-sid) Activates transparent session id propagation. --with-regex[=TYPE]] Use the system regex library (disapproved). --with-vpopmail[=DIR]] contains vpopmail support. --with-tsrm-pthreads. Use POSIX-ray range (default). --enable-shared[=PKGS] Compile shared library [default=yes]. --enable-static[=PKGS] Compile static library [default=yes]. --enable-fast-install[=PKGS]] Optimized for fast installation [default=yes]. --with-gnu-ld"Assumes that the C compiler uses GNU ld [default=no]. --disable-libtool-lock] Avoid locks (which may break parallel compilation). --with-pic Attempt to use only PIC/non-PIC objects [default=use both]. --enable-memory-limit Add memory restriction support at compile time. --disable-url-fopen-wrapper Prohibits fopen wrapper s through URLs and cannot access files over HTTP or FTP. --enable-versioning Outputs only the symbols needed.See the INSTALL file for more information. --with-imsp[=DIR]] Contains IMSp support (DIR is the IMSP include directory and libimsp.a directory).For PHP 3 only! --with-mck[=DIR]] Contains Cybercash MCK support.DIR is the Cybercash MCK compilation directory, defaulting to / usr/src/mck-3.2.0.3-Linux.See extra/cyberlib for help.For PHP 3 only! --with-mod-dav=DIR Contains DAV support through Apache's mod_dav.DIR is the installation directory for mod_dav (Apache module version only!)For PHP 3 only! --enable-debugger compiles into remote debugging functions.For PHP 3 only! --enable-versioning takes advantage of version control and scope provided by Solaris 2.x and Linux.For PHP 3 only! PHP Options --enable-maintainer-mode activation puts Compilation Rules and unused (and some confused) dependent files into a temporary installation. --with-config-file-path=PATH Sets the path where php.ini is located, defaulting to PREFIX/lib. --enable-safe-mode Default activation of safe mode. --with-exec-dir[=DIR]] Only programs in this directory are allowed to execute in secure mode.The default is/usr/local/php/bin. --enable-magic-quotes Default activation magic quotes. --disable-short-tags Defau lt prohibit abbreviated PHP start tags<?. Server Options --with-aolserver=DIR Specifies the path to the installed AOLserver. --with-apxs[=FILE]] Compile shared Apache modules.FILE is the path to the optional Apache's apxs tool, defaulting to apxs.Ensure that the specified apxs version is the installed file and not the Apache source package. --with-apache[=DIR]] Compile the Apache module.DIR is the highest level directory of Apache source programs.The default is/usr/local/apache. --with-mod_charset Activates the delivery table in mod_charset (in Apache). --with-apxs2[=FILE] -- Compile shared Apache 2.0 modules.FILE is the path to the optional Apache's apxs tool, defaulting to apxs. --with-fhttpd[=DIR]] Compile the fhttpd module.DIR is the source code path of fhttpd, defaulting to/usr/local/src/fhttpd. --with-isapi=DIR Compiles PHP as an ISAPI module for Zeus. --with-nsapi=DIR Specifies the installed Netscape server path. --with-phttpd=DIR --with-pi3web=DIR Compiles PHP as a module for Pi3Web. --with-roxen=DIR Compiles PHP into a Pike module.DIR is the root directory of Roxen, usually / usr/local/roxen/server. --enable-roxen-zts Compile the Roxen module using Zend Thread Safety. --with-servlet[=DIR]] Contains servlet support.DIR is the basic installation directory for JSDK.This SAPI requires that Java extensions must be compiled as shared dl s. --with-thttpd=SRCDIR -- Compiles PHP as a thttpd module. --with-tux=MODULEDIR -- Compiles PHP as a TUX module (Linux only).
Configure fpm user groups and users, and install other extensions
./configure --prefix=/usr/local/php \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --enable-mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --enable-mysqlnd-compression-support \ --with-iconv-dir \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir \ --enable-xml \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --enable-mbregex \ --enable-mbstring \ --enable-intl \ --with-mcrypt \ --with-libmbfl \ --enable-ftp \ --with-gd \ --enable-gd-jis-conv \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --with-gettext \ --disable-fileinfo \ --enable-opcache \ --with-pear \ --enable-maintainer-zts \ --with-ldap=shared \ --without-gdbm
Start checking dependencies and preparing for compilation
There are usually errors:
Error 1:
Solution: Without this sqlite3 package, we will install it
yum install sqlite-devel
Error 2:
Solution: It says we won't find this folder, so we'll give it one
cp -frp /usr/lib64/libldap* /usr/lib/
Error 3:
Solution: Without this oniguruma package, we will install it
yum install oniguruma
No, check the official update log and find that mbsting requires oniguruma6.9.4
Basic users and instances of git, the differences between GIT and github
#from github Download source code in git clone https://github.com/kkos/oniguruma
#Official Installation Steps possibly undefined macro: AM_INIT_AUTOMAKE Need to start #autoreconf install #To delete Pre-Ann's
yum remove onigurma*
cd oniguruma/ autoreconf -vfi ./configure make make install
Run. /configure, directly showing the following figure
Compile Installation (Installation takes a while)
make && make install
Mapping Global Commands
ln -s /usr/local/php/sbin/* /usr/local/sbin/ ln -s /usr/local/php/bin/* /usr/local/bin/
Enter php-v and the following figure appears, which makes the installation successful
Delete php7.4
rm -rf /usr/local/php /bin/php /usr/local/sbin/php-fpm /usr/local/bin/php /usr/local/bin/pear /usr/local/bin/peardev /usr/local/bin/pecl /usr/local/bin/phar /usr/local/bin/phar.phar /usr/local/bin/php-cgi /usr/local/bin/php-config /usr/local/bin/phpdbg /usr/local/bin/phpize
3.LNMP (One Click Installation Package) Installation Only (php7.4)
Reference Web Site
Official website found a version of php7.4. It was lnmp1.7 that started to support php7.4, but it was not a stable version. It is recommended to use a stable version if it is for production or production environments.
wget http://soft.vpser.net/lnmp/lnmp1.7beta.tar.gz
# decompression
tar -zxvf lnmp1.7beta.tar.gz
cd lnmp1.7
./install.sh
Enter 0 without installing DataBase
Enter 10 to install php7.4
You can choose not to install, Jemalloc or TCmalloc, enter the corresponding sequence number to return, direct return defaults to not install
The script will automatically download and install php7.4
LNMP-related software installation directory
Nginx directory: /usr/local/nginx/ MySQL directory: /usr/local/mysql/ The directory where the MySQL database is located: /usr/local/mysql/var/ MariaDB directory: /usr/local/mariadb/ Directory where MariaDB database is located: /usr/local/mariadb/var/ PHP directory: /usr/local/php/ Multi-PHP Version Directory: /usr/local/php5.5/Other Version 5.5 Version number before other version can be changed to other PHPMyAdmin directory: Version 0.9 is/home/wwwroot/phpmyadmin/1.0 and later is/home/wwwroot/default/phpmyadmin/It is strongly recommended that this directory be renamed to a name that is not easily guessed.PhpMyAdmin can download new replacements from its own website. Default site directory: version 0.9 is/home/wwwroot/ 1.0 and later is/home/wwroot/default/ Nginx log directory: /home/wwlogs/ /root/vhost.sh added virtual host configuration file directory: /usr/local/nginx/conf/vhost/ PureFtpd directory: /usr/local/pureftpd/ PureFtpd web administration directory: version 0.9 is/home/wwwroot/default/ftp/ version 1.0 is/home/wwwroot/default/ftp/ Proftpd directory: /usr/local/proftpd/ Redis directory: /usr/local/redis/
LNMP Related Profile Location
Nginx master configuration (default virtual host) file: /usr/local/nginx/conf/nginx.conf Added virtual host profile: /usr/local/nginx/conf/vhost/domain name.conf MySQL configuration file: /etc/my.cnf PHP Profile: /usr/local/php/etc/php.ini Php-fpm configuration file: /usr/local/php/etc/php-fpm.conf PureFtpd configuration file: /usr/local/pure ftpd/pure-ftpd.conf 1.3 and later: /usr/local/pure ftpd/etc/pure-ftpd.conf PureFtpd MySQL configuration file: /usr/local/pureftpd/pureftpd-mysql.conf Proftpd Profile: /usr/local/proftpd/etc/proftpd.conf 1.2 and previous versions are/usr/local/proftpd/proftpd.conf Proftpd user profile: /usr/local/proftpd/etc/vhost/user name.conf Redis configuration file: /usr/local/redis/etc/redis.conf
LNMPA Related Catalog File Location
Apache directory: /usr/local/apache/ Apache configuration file: /usr/local/apache/conf/httpd.conf Apache Virtual Host Profile Directory: /usr/local/apache/conf/vhost/ Apache default virtual host configuration file: /usr/local/apache/conf/extra/httpd-vhosts.conf Virtual Host Profile Name: /usr/local/apache/conf/vhost/domain name.conf
LNMP State Management Command:
LNMP 1.2+ State Management: lnmp {start|stop|reload|restart|kill|status}
LNMP 1.2+ Individual Program State Management: lnmp {nginx|mysql|mariadb|php-fpm|pureftpd} {start|stop|reload|restart|kill|status}
LNMP 1.1 State Management: /root/lnmp {start|stop|reload|restart|kill|status}
Nginx state management: /etc/init.d/nginx {start|stop|reload|restart}
MySQL state management: /etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached state management: /etc/init.d/memcached {start|stop|restart}
PHP-FPM status management: /etc/init.d/php-fpm {start|stop|quit|restart|reload|logrotate}
PureFTPd status management: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd status management: /etc/init.d/proftpd {start|stop|restart|reload}
Redis state management: /etc/init.d/redis {start|stop|restart|kill}
Multi-PHP Version Status Management: /etc/init.d/php-fpm5.5 {start|stop|quit|restart|reload|logrotate} The first 5.5 are the corresponding PHP versions, and other versions will replace themselves.
If you restart LNMP, 1.2+enter the command: lnmp restart; restart mysql:/etc/init.d/mysql restart alone can also lnmp mysql restart, both of which are the same.
LNMPA State Management Command:
LNMPA 1.2+ State Management: lnmp {start|stop|reload|restart|kill|status}
LNMPA 1.2+ Individual Program State Management: lnmp {httpd|mysql|mariadb|pureftpd} {start|stop|reload|restart|kill|status}
LNMPA1.1 State Management: /root/lnmpa {start|stop|reload|restart|kill|status}
Nginx state management: /etc/init.d/nginx {start|stop|reload|restart}
MySQL state management: /etc/init.d/mysql {start|stop|restart|reload|force-reload|status}
Memcached state management: /etc/init.d/memcached {start|stop|restart}
PureFTPd status management: /etc/init.d/pureftpd {start|stop|restart|kill|status}
ProFTPd status management: /etc/init.d/proftpd {start|stop|restart|reload}
Apache state management: /etc/init.d/httpd {start|stop|restart|graceful|graceful-stop|configtest|status}
LAMP Status Management Command:
LAMP 1.2+ State Management: lnmp {start|stop|reload|restart|kill|status}
LAMP 1.2+ individual program state management: lnmp {httpd|mysql|mariadb|pureftpd} {start|stop|reload|restart|kill|status}