升级PHP7.1,Composer

2017-03-30  本文已影响0人  Godtoy

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

2.解压
tar

3.configure

4.make && make install
如果出现如下报错
/ext/iconv/iconv.c:2465: undefined reference to `libiconv'

我个人的解决方案是 --without一下,这个模块我们可以后续的再给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

新问题

[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
安装一下这个就行了
上一篇下一篇

猜你喜欢

热点阅读