Maison  >  Article  >  développement back-end  >  Tutoriel détaillé pour installer php7.3 sur Alibaba Cloud centos7.6

Tutoriel détaillé pour installer php7.3 sur Alibaba Cloud centos7.6

不言
不言avant
2019-01-01 10:02:2227148parcourir

Cet article vous propose un tutoriel détaillé sur l'installation de php7.3 sur Alibaba Cloud centos7.6. Il a une certaine valeur de référence. Les amis dans le besoin peuvent s'y référer. J'espère qu'il vous sera utile.

Ajouter un groupe d'utilisateurs

groupadd www
useradd -g www www

Télécharger php

wget "https://downloads.php.net/~cmb/php-7.3.0.tar.gz"
tar xzvf php-7.3.0.tar.gz
cd  php-7.3.0

Compiler

--with-fpm-user=www --with -fpm -group=www
Le programme compilé à l'aide de l'utilisateur www www et du groupe d'utilisateurs
est démarré ici, qui appartient à cet utilisateur et groupe d'utilisateurs

./configure --prefix=/usr/local/php --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --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-zip --enable-fpm

Erreur de compilation, résoudre les dépendances

configurer : erreur : libxml2 introuvable. Veuillez vérifier votre installation de libxml2.

yum install -y  libxml2-devel

configurer : erreur : veuillez réinstaller la distribution BZip2. La version 7.15.5 ou ultérieure est requise pour compiler php avec le support cURL

yum install -y  bzip2-devel

configurer : erreur : jpeglib.h introuvable.

yum install -y  curl-devel

configurer : erreur : png.h introuvable .

yum install -y  libjpeg-devel

configurer : erreur : freetype- config introuvable.

yum install -y libpng-devel

configure : erreur : xslt-config not found. Veuillez réinstaller la distribution libxslt >= 1.1.0

yum install -y freetype-devel

configure : erreur : veuillez réinstaller le. distribution libzip

yum install -y libxslt-devel

vérification de libzip... configurer : erreur : le système libzip doit être mis à niveau vers la version >= 0.11

yum install -y libzip-devel

off_t erreur non définie

#先删除旧版本
yum remove -y libzip

#下载编译安装
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

le type off_t est défini dans le fichier d'en-tête unistd.h

est programmé en long int dans les systèmes 32 bits et compilé en long int dans les systèmes 64 bits,
checking libzip... yes
checking for the location of zlib... /usr
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libzip... in default path: found in /usr/local
checking for zip_open in -lzip... yes
checking for zip_file_set_encryption in -lzip... yes
checking for zip_libzip_version in -lzip... no
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking fts.h usability... yes
checking fts.h presence... yes
checking for fts.h... yes
checking for int8_t... (cached) yes
checking for int16_t... (cached) yes
checking for int32_t... (cached) yes
checking for int64_t... (cached) yes
checking for uint8_t... (cached) yes
checking for uint16_t... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... (cached) yes
checking for ssize_t... yes
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking size of off_t... 0
configure: error: off_t undefined; check your library configuration
recherche le 64. -bit bibliothèque de liens dynamiques par défaut lors de la compilation,

mais par défaut, le chemin de recherche n'est pas ajouté au fichier de configuration de la bibliothèque de liens dynamiques centos /etc/ld.so.conf ,
À ce stade, vous devez ajoutez /usr/local/lib64 /usr/lib64 ces chemins de fichiers de bibliothèque 64 bits.


Installation

#添加搜索路径到配置文件
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

#然后 更新配置
ldconfig -v

Rapport d'erreur

usr/local/include/zip.h:59:21 : erreur fatale : zipconf.h : aucun fichier ou répertoire de ce type
make && make install


Réussissez la sortie de la configuration

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

et créez le répertoire

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/
Installing PHP CLI binary:        /usr/local/php/bin/
Installing PHP CLI man page:      /usr/local/php/php/man/man1/
Installing PHP FPM binary:        /usr/local/php/sbin/
Installing PHP FPM defconfig:     /usr/local/php/etc/
Installing PHP FPM man page:      /usr/local/php/php/man/man8/
Installing PHP FPM status page:   /usr/local/php/php/php/fpm/
Installing phpdbg binary:         /usr/local/php/bin/
Installing phpdbg man page:       /usr/local/php/php/man/man1/
Installing PHP CGI binary:        /usr/local/php/bin/
Installing PHP CGI man page:      /usr/local/php/php/man/man1/
Installing build environment:     /usr/local/php/lib/php/build/
Installing header files:          /usr/local/php/include/php/
Installing helper programs:       /usr/local/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php/lib/php/

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///home/flame/software/php-7.3.0/pear/install-pear-nozlib.phar/PEAR/PackageFile/v2/Validator.php on line 1933
[PEAR] Archive_Tar    - installed: 1.4.3
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.2
[PEAR] PEAR           - installed: 1.10.5
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
/home/flame/software/php-7.3.0/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers:           /usr/local/php/include/php/ext/pdo/

Entrez
cp php.ini-production /usr/local/php/lib/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
ln -s /usr/local/php/sbin/php-fpm /usr/local/bin
cd /usr/local/php/etc/php-fpm.d
vim www.conf

pour rejoindre le service systemtl

[www]
listen = 127.0.0.1:9080   
listen.mode = 0666      

user = www  #php代码目录权限 需要跟这个一致,
group = www #php代码目录权限 需要跟这个一致

pm = dynamic
pm.max_children = 128
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 10000

rlimit_files = 1024

slowlog = log/$pool.log.slow

Démarrer

cd /home/flame/software/php-7.3.0/sapi/fpm
cp php-fpm.service /usr/lib/systemd/system/

Test
systemctl start php-fpm
#查看状态
systemctl status php-fpm

#得到输出
● php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2018-12-27 16:13:16 CST; 2s ago
 Main PID: 16835 (php-fpm)
   CGroup: /system.slice/php-fpm.service
           ├─16835 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
           ├─16836 php-fpm: pool www
           ├─16837 php-fpm: pool www
           ├─16838 php-fpm: pool www
           ├─16839 php-fpm: pool www
           ├─16840 php-fpm: pool www
           ├─16841 php-fpm: pool www
           ├─16842 php-fpm: pool www
           ├─16843 php-fpm: pool www
           ├─16844 php-fpm: pool www
           ├─16845 php-fpm: pool www
           ├─16846 php-fpm: pool www
           ├─16847 php-fpm: pool www
           ├─16848 php-fpm: pool www
           ├─16849 php-fpm: pool www
           ├─16850 php-fpm: pool www
           ├─16851 php-fpm: pool www
           ├─16852 php-fpm: pool www
           ├─16853 php-fpm: pool www
           ├─16854 php-fpm: pool www
           └─16855 php-fpm: pool www

Dec 27 16:13:16 iZj6cas4fyg41lxhngh1z0Z systemd[1]: Started The PHP FastCGI Process Manager.

Entrer

mkdir -p /home/www/webroot/php
cd /home/www/webroot/php
vim test.php

Visiter

xxx .xxx.xxx. xxx:8080/test.php
<?php

phpinfo();

?>

environnement de commande php

Le nouveau contenu dans $HOME/.profile est

export PATH=$PATH:/usr/local/php/bin

Colonne







Publié il y a 1 jour

Alibaba Cloud centos7.6 installer php7.3

  • php

  • centos

  • linux

                                                                                                                                                                                                                                                                 La lecture prend 26 minutes                                                                                                                                >                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                


Ajouter un groupe d'utilisateurs


Télécharger php


Compiler

--with-fpm-user=www --with-fpm-group=wwwLe programme compilé ici à l'aide de l'utilisateur www www et du groupe d'utilisateurs

est démarré et appartient à cet utilisateur ou groupe d'utilisateurs

Erreur de compilation, résoudre les dépendancesconfigurer : erreur : libxml2 introuvable. Veuillez vérifier votre installation de libxml2.configurer : erreur : veuillez réinstaller le BZip2. distributionconfigurer : erreur : cURL version 7.15.5 ou ultérieure est requise pour compiler php avec le support cURL

configurer : erreur : jpeglib.h introuvable


configurer : erreur : png.h introuvable.

configurer : erreur : freetype-config introuvable.
groupadd www
useradd -g www www

configurer : erreur : xslt -config introuvable. Veuillez réinstaller la distribution libxslt >= 1.1.0
wget "https://downloads.php.net/~cmb/php-7.3.0.tar.gz"
tar xzvf php-7.3.0.tar.gz
cd  php-7.3.0

configure : erreur : veuillez réinstaller la distribution libzip


en vérifiant libzip.. . : erreur : le système libzip doit être mis à niveau vers la version >= 0.11



off_t non défini L'erreur

./configure --prefix=/usr/local/php --with-fpm-user=www --with-fpm-group=www --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --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-zip --enable-fpm

le type off_t est défini dans le fichier d'en-tête unistd.h,

Programmé en long int dans un système 32 bits et compilé en long long int dans un système 64 bits

Lors de la compilation, il recherche par défaut la bibliothèque de liens dynamiques 64 bits

Mais par défaut, centos Dynamic. bibliothèque de liens Le chemin de recherche n'est pas ajouté au fichier de configuration de la bibliothèque de liens /etc/ld.so.conf
yum install -y  libxml2-devel
À ce stade, vous devez ajouter /usr/local/lib64 /usr/lib64 ces fichiers de bibliothèque 64 bits. chemins.

yum install -y  bzip2-devel
Installation

yum install -y  curl-devel
Rapport d'erreur

usr/local/include/zip.h:59:21 : erreur fatale : zipconf.h : aucun fichier ou répertoire de ce type

yum install -y  libjpeg-devel

Réussissez la sortie de la configuration

yum install -y libpng-devel

et créez le répertoire

yum install -y freetype-devel

Entrez
yum install -y libxslt-devel

pour rejoindre le service systemtl
yum install -y libzip-devel

Démarrer
#先删除旧版本
yum remove -y libzip

#下载编译安装
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

checking libzip... yes
checking for the location of zlib... /usr
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libzip... in default path: found in /usr/local
checking for zip_open in -lzip... yes
checking for zip_file_set_encryption in -lzip... yes
checking for zip_libzip_version in -lzip... no
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking fts.h usability... yes
checking fts.h presence... yes
checking for fts.h... yes
checking for int8_t... (cached) yes
checking for int16_t... (cached) yes
checking for int32_t... (cached) yes
checking for int64_t... (cached) yes
checking for uint8_t... (cached) yes
checking for uint16_t... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... (cached) yes
checking for ssize_t... yes
checking size of short... (cached) 2
checking size of int... (cached) 4
checking size of long... (cached) 8
checking size of long long... (cached) 8
checking size of off_t... 0
configure: error: off_t undefined; check your library configuration
Test



Entrer

Visiter
#添加搜索路径到配置文件
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

#然后 更新配置
ldconfig -v
xxx .xxx.xxx. xxx:8080/test.php

environnement de commande php
make && make install

Le nouveau contenu dans $HOME/.profile est

export PATH=$PATH:/usr/local/php/bin

               


  • Tutoriel détaillé pour installer php7.3 sur Alibaba Cloud centos7.6





你可能感兴趣的





评论                                                    

默认排序                        时间排序



载入中...

显示更多评论



Ce qui précède est le contenu détaillé de. pour plus d'informations, suivez d'autres articles connexes sur le site Web de PHP en chinois!

Déclaration:
Cet article est reproduit dans:. en cas de violation, veuillez contacter admin@php.cn Supprimer