麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 編程 > PHP > 正文

阿里云centos7.6安裝php7.3的詳細教程

2020-03-22 19:53:23
字體:
來源:轉載
供稿:網友
本篇文章給大家帶來的內容是關于阿里云centos7.6安裝php7.3的詳細教程,有一定的參考價值,有需要的朋友可以參考一下,希望對你有所幫助。

新增用戶 用戶組
groupadd wwwuseradd -g www www
下載 php
wget https://downloads.php.net/~cmb/php-7.3.0.tar.gz tar xzvf php-7.3.0.tar.gzcd php-7.3.0
編譯

--with-fpm-user=www --with-fpm-group=www
這里使用www www 用戶、用戶組
編譯出來的程序啟動,就是歸屬這個用戶、用戶組

./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
編譯錯誤,解決依賴

configure: error: libxml2 not found. Please check your libxml2 installation.

yum install -y libxml2-devel

configure: error: Please reinstall the BZip2 distribution

yum install -y bzip2-devel

configure: error: cURL version 7.15.5 or later is required to compile php with cURL support

yum install -y curl-devel

configure: error: jpeglib.h not found.

yum install -y libjpeg-devel

configure: error: png.h not found.

yum install -y libpng-devel

configure: error: freetype-config not found.

yum install -y freetype-devel

configure: error: xslt-config not found. Please reinstall the libxslt = 1.1.0 distribution

yum install -y libxslt-devel

configure: error: Please reinstall the libzip distribution

yum install -y libzip-devel

checking for libzip... configure: error: system libzip must be upgraded to version = 0.11

#先刪除舊版本yum remove -y libzip#下載編譯安裝wget https://nih.at/libzip/libzip-1.2.0.tar.gztar -zxvf libzip-1.2.0.tar.gzcd libzip-1.2.0./configuremake make install

off_t undefined 報錯

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

off_t 類型是在 頭文件 unistd.h中定義的,
在32位系統 編程成 long int ,64位系統則編譯成 long long int ,
在進行編譯的時候 是默認查找64位的動態鏈接庫,
但是默認情況下 centos 的動態鏈接庫配置文件/etc/ld.so.conf里并沒有加入搜索路徑,
這個時候需要將 /usr/local/lib64 /usr/lib64 這些針對64位的庫文件路徑加進去。

#添加搜索路徑到配置文件echo /usr/local/lib64/usr/local/lib/usr/lib/usr/lib64 /etc/ld.so.conf#然后 更新配置ldconfig -v
安裝
make make install

報錯
usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory

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

成功輸出

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-configInstalling man pages: /usr/local/php/php/man/man1/ page: phpize.1 page: php-config.1Installing 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.5Wrote PEAR system config file at: /usr/local/php/etc/pear.confYou 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/binln -s -f phar.phar /usr/local/php/bin/pharInstalling PDO headers: /usr/local/php/include/php/ext/pdo/
配置,建立目錄
cp php.ini-production /usr/local/php/lib/php.inicp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confln -s /usr/local/php/sbin/php-fpm /usr/local/bin
cd /usr/local/php/etc/php-fpm.dvim www.conf

輸入

[www]listen = 127.0.0.1:9080 listen.mode = 0666 user = www #php代碼目錄權限 需要跟這個一致,group = www #php代碼目錄權限 需要跟這個一致pm = dynamicpm.max_children = 128pm.start_servers = 20pm.min_spare_servers = 5pm.max_spare_servers = 35pm.max_requests = 10000rlimit_files = 1024slowlog = log/$pool.log.slow
加入 systemtl 服務
cd /home/flame/software/php-7.3.0/sapi/fpmcp php-fpm.service /usr/lib/systemd/system/
啟動
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 wwwDec 27 16:13:16 iZj6cas4fyg41lxhngh1z0Z systemd[1]: Started The PHP FastCGI Process Manager.
測試
mkdir -p /home/www/webroot/phpcd /home/www/webroot/phpvim test.php

輸入

 ?phpphpinfo();? 

訪問
xxx.xxx.xxx.xxx:8080/test.php

php 命令環境

在$HOME/.profile里新增內容為

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

專欄

文章詳情








flamefatex


flamefatex 21%201%20天前發布%20%20

阿里云%20centos7.6%20安裝%20php7.3


php

centos

linux

%2043%20次閱讀%20讀完需要%2026%20分鐘%20%20




%20

%20


新增用戶%20用戶組
groupadd%20wwwuseradd%20-g%20www%20www
下載%20php
wget%20https://downloads.php.net/~cmb/php-7.3.0.tar.gz%20tar%20xzvf%20php-7.3.0.tar.gzcd%20php-7.3.0
編譯


--with-fpm-user=www%20--with-fpm-group=www
這里使用www%20www%20用戶、用戶組
編譯出來的程序啟動,就是歸屬這個用戶、用戶組

./configure%20--prefix=/usr/local/php%20--with-fpm-user=www%20--with-fpm-group=www%20--with-curl%20--with-freetype-dir%20--with-gd%20--with-gettext%20--with-iconv-dir%20--with-kerberos%20--with-libdir=lib64%20--with-libxml-dir%20--with-mysqli%20--with-openssl%20--with-pcre-regex%20--with-pdo-mysql%20--with-pdo-sqlite%20--with-pear%20--with-png-dir%20--with-jpeg-dir%20--with-xmlrpc%20--with-xsl%20--with-zlib%20--with-bz2%20--with-mhash%20--enable-fpm%20--enable-bcmath%20--enable-libxml%20--enable-inline-optimization%20--enable-mbregex%20--enable-mbstring%20--enable-opcache%20--enable-pcntl%20--enable-shmop%20--enable-soap%20--enable-sockets%20--enable-sysvsem%20--enable-sysvshm%20--enable-xml%20--enable-zip%20--enable-fpm
編譯錯誤,解決依賴

configure:%20error:%20libxml2%20not%20found.%20Please%20check%20your%20libxml2%20installation.

yum%20install%20-y%20libxml2-devel

configure:%20error:%20Please%20reinstall%20the%20BZip2%20distribution

yum%20install%20-y%20bzip2-devel

configure:%20error:%20cURL%20version%207.15.5%20or%20later%20is%20required%20to%20compile%20php%20with%20cURL%20support

yum%20install%20-y%20curl-devel

configure:%20error:%20jpeglib.h%20not%20found.

yum%20install%20-y%20libjpeg-devel

configure:%20error:%20png.h%20not%20found.

yum%20install%20-y%20libpng-devel

configure:%20error:%20freetype-config%20not%20found.

yum%20install%20-y%20freetype-devel

configure:%20error:%20xslt-config%20not%20found.%20Please%20reinstall%20the%20libxslt%20=%201.1.0%20distribution

yum%20install%20-y%20libxslt-devel

configure:%20error:%20Please%20reinstall%20the%20libzip%20distribution

yum%20install%20-y%20libzip-devel

checking%20for%20libzip...%20configure:%20error:%20system%20libzip%20must%20be%20upgraded%20to%20version%20=%200.11

#先刪除舊版本yum%20remove%20-y%20libzip#下載編譯安裝wget%20https://nih.at/libzip/libzip-1.2.0.tar.gztar%20-zxvf%20libzip-1.2.0.tar.gzcd%20libzip-1.2.0./configuremake%20make%20install

off_t%20undefined%20報錯

checking%20libzip...%20yeschecking%20for%20the%20location%20of%20zlib...%20/usrchecking%20for%20pkg-config...%20(cached)%20/usr/bin/pkg-configchecking%20for%20libzip...%20in%20default%20path:%20found%20in%20/usr/localchecking%20for%20zip_open%20in%20-lzip...%20yeschecking%20for%20zip_file_set_encryption%20in%20-lzip...%20yeschecking%20for%20zip_libzip_version%20in%20-lzip...%20nochecking%20stdbool.h%20usability...%20yeschecking%20stdbool.h%20presence...%20yeschecking%20for%20stdbool.h...%20yeschecking%20fts.h%20usability...%20yeschecking%20fts.h%20presence...%20yeschecking%20for%20fts.h...%20yeschecking%20for%20int8_t...%20(cached)%20yeschecking%20for%20int16_t...%20(cached)%20yeschecking%20for%20int32_t...%20(cached)%20yeschecking%20for%20int64_t...%20(cached)%20yeschecking%20for%20uint8_t...%20(cached)%20yeschecking%20for%20uint16_t...%20(cached)%20yeschecking%20for%20uint32_t...%20(cached)%20yeschecking%20for%20uint64_t...%20(cached)%20yeschecking%20for%20ssize_t...%20yeschecking%20size%20of%20short...%20(cached)%202checking%20size%20of%20int...%20(cached)%204checking%20size%20of%20long...%20(cached)%208checking%20size%20of%20long%20long...%20(cached)%208checking%20size%20of%20off_t...%200configure:%20error:%20off_t%20undefined;%20check%20your%20library%20configuration

off_t%20類型是在%20頭文件%20unistd.h中定義的,
在32位系統%20編程成%20long%20int%20,64位系統則編譯成%20long%20long%20int%20,
在進行編譯的時候%20是默認查找64位的動態鏈接庫,
但是默認情況下%20centos%20的動態鏈接庫配置文件/etc/ld.so.conf里并沒有加入搜索路徑,
這個時候需要將%20/usr/local/lib64%20/usr/lib64%20這些針對64位的庫文件路徑加進去。

#添加搜索路徑到配置文件echo%20/usr/local/lib64/usr/local/lib/usr/lib/usr/lib64%20/etc/ld.so.conf#然后%20更新配置ldconfig%20-v
安裝
make%20make%20install

報錯
usr/local/include/zip.h:59:21:%20fatal%20error:%20zipconf.h:%20No%20such%20file%20or%20directory

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

成功輸出

Installing%20shared%20extensions:%20/usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/Installing%20PHP%20CLI%20binary:%20/usr/local/php/bin/Installing%20PHP%20CLI%20man%20page:%20/usr/local/php/php/man/man1/Installing%20PHP%20FPM%20binary:%20/usr/local/php/sbin/Installing%20PHP%20FPM%20defconfig:%20/usr/local/php/etc/Installing%20PHP%20FPM%20man%20page:%20/usr/local/php/php/man/man8/Installing%20PHP%20FPM%20status%20page:%20/usr/local/php/php/php/fpm/Installing%20phpdbg%20binary:%20/usr/local/php/bin/Installing%20phpdbg%20man%20page:%20/usr/local/php/php/man/man1/Installing%20PHP%20CGI%20binary:%20/usr/local/php/bin/Installing%20PHP%20CGI%20man%20page:%20/usr/local/php/php/man/man1/Installing%20build%20environment:%20/usr/local/php/lib/php/build/Installing%20header%20files:%20/usr/local/php/include/php/Installing%20helper%20programs:%20/usr/local/php/bin/%20program:%20phpize%20program:%20php-configInstalling%20man%20pages:%20/usr/local/php/php/man/man1/%20page:%20phpize.1%20page:%20php-config.1Installing%20PEAR%20environment:%20/usr/local/php/lib/php/Warning:%20continue%20targeting%20switch%20is%20equivalent%20to%20break%20.%20Did%20you%20mean%20to%20use%20continue%202%20?%20in%20phar:///home/flame/software/php-7.3.0/pear/install-pear-nozlib.phar/PEAR/PackageFile/v2/Validator.php%20on%20line%201933[PEAR]%20Archive_Tar%20-%20installed:%201.4.3[PEAR]%20Console_Getopt%20-%20installed:%201.4.1[PEAR]%20Structures_Graph-%20installed:%201.1.1[PEAR]%20XML_Util%20-%20installed:%201.4.2[PEAR]%20PEAR%20-%20installed:%201.10.5Wrote%20PEAR%20system%20config%20file%20at:%20/usr/local/php/etc/pear.confYou%20may%20want%20to%20add:%20/usr/local/php/lib/php%20to%20your%20php.ini%20include_path/home/flame/software/php-7.3.0/build/shtool%20install%20-c%20ext/phar/phar.phar%20/usr/local/php/binln%20-s%20-f%20phar.phar%20/usr/local/php/bin/pharInstalling%20PDO%20headers:%20/usr/local/php/include/php/ext/pdo/
配置,建立目錄
cp%20php.ini-production%20/usr/local/php/lib/php.inicp%20/usr/local/php/etc/php-fpm.conf.default%20/usr/local/php/etc/php-fpm.confln%20-s%20/usr/local/php/sbin/php-fpm%20/usr/local/bin
cd%20/usr/local/php/etc/php-fpm.dvim%20www.conf

輸入

[www]listen%20=%20127.0.0.1:9080%20listen.mode%20=%200666%20user%20=%20www%20#php代碼目錄權限%20需要跟這個一致,group%20=%20www%20#php代碼目錄權限%20需要跟這個一致pm%20=%20dynamicpm.max_children%20=%20128pm.start_servers%20=%2020pm.min_spare_servers%20=%205pm.max_spare_servers%20=%2035pm.max_requests%20=%2010000rlimit_files%20=%201024slowlog%20=%20log/$pool.log.slow
加入%20systemtl%20服務
cd%20/home/flame/software/php-7.3.0/sapi/fpmcp%20php-fpm.service%20/usr/lib/systemd/system/
啟動
systemctl%20start%20php-fpm
#查看狀態systemctl%20status%20php-fpm#得到輸出●%20php-fpm.service%20-%20The%20PHP%20FastCGI%20Process%20Manager%20Loaded:%20loaded%20(/usr/lib/systemd/system/php-fpm.service;%20disabled;%20vendor%20preset:%20disabled)%20Active:%20active%20(running)%20since%20Thu%202018-12-27%2016:13:16%20CST;%202s%20ago%20Main%20PID:%2016835%20(php-fpm)%20CGroup:%20/system.slice/php-fpm.service%20├─16835%20php-fpm:%20master%20process%20(/usr/local/php/etc/php-fpm.conf)%20├─16836%20php-fpm:%20pool%20www%20├─16837%20php-fpm:%20pool%20www%20├─16838%20php-fpm:%20pool%20www%20├─16839%20php-fpm:%20pool%20www%20├─16840%20php-fpm:%20pool%20www%20├─16841%20php-fpm:%20pool%20www%20├─16842%20php-fpm:%20pool%20www%20├─16843%20php-fpm:%20pool%20www%20├─16844%20php-fpm:%20pool%20www%20├─16845%20php-fpm:%20pool%20www%20├─16846%20php-fpm:%20pool%20www%20├─16847%20php-fpm:%20pool%20www%20├─16848%20php-fpm:%20pool%20www%20├─16849%20php-fpm:%20pool%20www%20├─16850%20php-fpm:%20pool%20www%20├─16851%20php-fpm:%20pool%20www%20├─16852%20php-fpm:%20pool%20www%20├─16853%20php-fpm:%20pool%20www%20├─16854%20php-fpm:%20pool%20www%20└─16855%20php-fpm:%20pool%20wwwDec%2027%2016:13:16%20iZj6cas4fyg41lxhngh1z0Z%20systemd[1]:%20Started%20The%20PHP%20FastCGI%20Process%20Manager.
測試
mkdir%20-p%20/home/www/webroot/phpcd%20/home/www/webroot/phpvim%20test.php

輸入

%20?phpphpinfo();?%20

訪問
xxx.xxx.xxx.xxx:8080/test.php

php%20命令環境

在$HOME/.profile里新增內容為

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

%20



舉報





你可能感興趣的





評論%20

默認排序%20時間排序



載入中...

顯示更多評論


以上就是阿里云centos7.6安裝php7.3的詳細教程的詳細內容,PHP教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 成熟女人特级毛片www免费 | 国产98色在线 | 91精品国产日韩91久久久久久360 | 久久久久久久久久性 | 蜜桃麻豆视频 | 国内久久久久 | 国产精品久久久久无码av | 久草亚洲视频 | av在线免费电影 | 精品国产视频一区二区三区 | 99精品热视频 | 中国美女一级黄色片 | 亚州精品在线视频 | 久久精品国产久精国产 | 天天躁狠狠躁夜躁2020挡不住 | 亚洲午夜精品视频 | 国产乱淫av| 国产女同疯狂激烈互摸 | 欧美久久久一区二区三区 | 91久久国产综合精品女同国语 | 看免费黄色大片 | 久久久久久艹 | 亚洲第一黄色网 | 13一14毛片免费看 | 九九精品在线观看视频 | 国语自产免费精品视频在 | 久久777国产线看观看精品 | 久久影院国产精品 | 午夜视频在线看 | 国语自产免费精品视频在 | 2021免费日韩视频网 | 欧美日韩中文字幕在线视频 | 久久精品视频12 | 高清视频91 | 色视频欧美| 爱草成年 | 美女黄色影院 | 国产精品久久久久久久久久三级 | 欧美一级做一a做片性视频 日韩黄色片免费看 | 成人午夜精品久久久久久久蜜臀 | 国产毛片毛片毛片 |