升級(jí)PHP7.1,Composer

1.下載src
http://php.net

2.解壓
tar

3.configure

4.make && make install
如果出現(xiàn)如下報(bào)錯(cuò)
/ext/iconv/iconv.c:2465: undefined reference to `libiconv'

我個(gè)人的解決方案是 --without一下,這個(gè)模塊我們可以后續(xù)的再給php去添加

[root@php-7.1.3]# mv php.ini-production /server/programs/php7.1/lib/php.ini
[root@php-7.1.3]# cd /server/programs/php7.1/
[root@php7.1]# ls
bin  etc  include  lib  php  sbin  var
[root@php7.1]# cd etc/
[root@etc]# ls
pear.conf  php-fpm.conf.default  php-fpm.d
[root@etc]# mv php-fpm.
php-fpm.conf.default  php-fpm.d/            
[root@etc]# mv php-fpm.conf.default php-fpm.conf
[root@etc]# vim php-fpm.
[root@etc]# vim php-fpm.conf 

5.添加libiconv,添加zlib,

[root@iZ94568y7h9Z zlib]# /server/programs/php7.1/bin/phpize 
Cannot find config.m4. 
Make sure that you run '/server/programs/php7.1/bin/phpize' in the top level source directory of the module

[root@iZ94568y7h9Z zlib]# ll
total 112
-rw-rw-r-- 1 www www  1952 Mar 14 21:17 config0.m4
-rw-rw-r-- 1 www www   604 Mar 14 21:17 config.w32
-rw-rw-r-- 1 www www    84 Mar 14 21:17 CREDITS
-rw-rw-r-- 1 www www  1995 Mar 14 21:17 package.xml
-rw-rw-r-- 1 www www   921 Mar 14 21:17 php_zlib.def
-rw-rw-r-- 1 www www  2986 Mar 14 21:17 php_zlib.h
drwxrwxr-x 2 www www 12288 Mar 14 21:17 tests
-rw-rw-r-- 1 www www 46774 Mar 14 21:17 zlib.c
-rw-rw-r-- 1 www www 13167 Mar 14 21:17 zlib_filter.c
-rw-rw-r-- 1 www www  5262 Mar 14 21:17 zlib_fopen_wrapper.c
-rw-rw-r-- 1 www www   331 Mar 14 21:17 zlib_win32_howto.txt
[root@iZ94568y7h9Z zlib]# cp config0.m4 config.m4
[root@iZ94568y7h9Z zlib]# /server/programs/php7.1/bin/phpize 
Paste_Image.png
Paste_Image.png
#make && make install
最后修改一下ini

6.安裝composer

[root@bin]# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
[root@bin]# ./php composer-setup.php

Paste_Image.png

添加軟鏈接

Paste_Image.png

新問(wèn)題

[root@iZ94568y7h9Z cms_v1]# composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - hashids/hashids 2.0.3 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - hashids/hashids 2.0.2 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - hashids/hashids 2.0.1 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - hashids/hashids 2.0.0 requires ext-bcmath * -> the requested PHP extension bcmath is missing from your system.
    - lavalite/framework v2.1.2 requires hashids/hashids 2.0.* -> satisfiable by hashids/hashids[2.0.0, 2.0.1, 2.0.2, 2.0.3].
    - Installation request for lavalite/framework 2.1.2 -> satisfiable by lavalite/framework[v2.1.2].

  To enable extensions, verify that they are enabled in your .ini files:
    - /server/programs/php7.1/lib/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

解決方案:

Paste_Image.png
安裝一下這個(gè)就行了
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容