Heim  >  Artikel  >  Backend-Entwicklung  >  Detaillierte Erklärung der PHP7.3-Installation

Detaillierte Erklärung der PHP7.3-Installation

coldplay.xixi
coldplay.xixinach vorne
2020-12-29 09:51:563593Durchsuche

PHP7Die Kolumne stellt vor, wie man PHP7.3 effektiv installiert

Detaillierte Erklärung der PHP7.3-Installation

Empfohlen (kostenlos): PHP7

Erstinstallation (Sie müssen es danach nicht mehr installieren installiert):

mysql: https://blog.csdn.net/qq_40200087/article/details/89479137

nginx: https://blog.csdn.net/qq_40200087/article/details/89504980

Download: https ://www.php.net/downloads.php#v7.3.4

Entwicklungstools:

 yum groupinstall "Development Tools" -y

Installationsabhängigkeiten:

yum install libxml2-devel -y

yum install bzip2 bzip2-devel -y 

yum install curl-devel -y

yum install libjpeg-devel -y

yum install libpng libpng-devel -y

yum install freetype-devel -y

yum install libxslt-devel -y 

yum install libzip-devel  -y


或者合到一起安装
yum install libxml2-devel bzip2 bzip2-devel curl-devel libjpeg-devel libpng libpng-devel freetype-devel libxslt-devel libzip-devel -y

Entpacken:

tar -zxvf php-xxx.tar.gz -C /usr/local/

Gehe zu /usr/local und ändere den Namen

cd /usr/local

mv php-7.3.xxx  php7.3

Kompilieren

cd /usr/local/php7.3 

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-fpm-user=mysql --with-fpm-group=mysql --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli=mysqlnd --with-openssl --with-pcre-regex --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-fpm
编译完成后是以下样子

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php7.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/www.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/phpdbg/phpdbg.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
configure: WARNING: unrecognized options: --with-mysql

Installation:

make && make install

Kopieren Sie die folgenden drei Konfigurationsdateien

cp php.ini-production /usr/local/php/etc/php.ini

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

cp /usr/local/php/etc/php-fpm.d/www.conf.default  /usr/local/php/etc/php-fpm.d/www.conf

Setzen Sie php.ini

#注意:php的注释为 ; 如果设置前面有 ; ,请记得删除 ;
vim /usr/local/php/etc/php.ini

max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
date.timezone = Asia/Shanghai

Testen Sie, ob PHP erfolgreich installiert wurde

/usr/local/php/sbin/php-fpm -t

Kopieren Sie die Startdatei

cp /usr/local/php7.3/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

Erteilen Sie die Ausführungserlaubnis

chmod 755 /etc/init.d/php-fpm

Starten Sie

service php-fpm start

Abfrage ob der Start erfolgreich ist

Das obige ist der detaillierte Inhalt vonDetaillierte Erklärung der PHP7.3-Installation. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Dieser Artikel ist reproduziert unter:csdn.net. Bei Verstößen wenden Sie sich bitte an admin@php.cn löschen