Version Upgrade for PHP

Source: Internet
Author: User
Tags fpm pear php redis zts

Why write this article is also because I made a mistake, or found today.

Today I'm trying to upgrade my php Redis extension to the latest

Then, in order not to affect the impact of the local development environment, I foolishly copied a copy.

[email protected] php]# LL

Total 16

Drwxr-xr-x 9 root root 4096 Nov 10 2015 5.4.45

Drwxr-xr-x 9 root root 4096 3 10:37 5.4.45.bak

Drwxr-xr-x 9 root root 4096 3 09:52 7.0.2

Drwxr-xr-x 9 root root 4096 Jan 7.0.2.bak

lrwxrwxrwx 1 root root 21:02 php--/usr/local/php/5.4.45

[Email protected] php]#


Here is a description of the version of PHP I am using a soft connection

[[email protected] php]# which PHP

/usr/bin/php

[Email protected] php]# ll/usr/bin/php

lrwxrwxrwx 1 root root 2016/usr/bin/php-/usr/local/php/php/bin/php

[Email protected] php]#


In order to flexibly update PHP using LN has been only to/usr/local/php/php this file to do soft connection so I want to switch 7.0.2
All you need is a ln-snf/usr/local/php/7.0.2/usr/local/php/php.

[Email protected] php]# ln-snf/usr/local/php/7.0.2/usr/local/php/php

[[email protected] php]# PHP--version

PHP 7.0.2 (CLI) (Built:jan 01:31:08) (NTS)

Copyright (c) 1997-2015 the PHP Group

Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

[Email protected] php]#


Back to Topic

I foolishly copied a copy of the original wanted to upgrade 5.4.45.bak but otherwise.

More information, such as the LD (1) and ld.so (8) manual pages.

----------------------------------------------------------------------

Installing Shared extensions:/usr/local/php/5.4.45/lib/php/extensions/no-debug-non-zts-20100525/

[Email protected] redis-2.2.8]#


Whether I define Php-config phpize these two files are still updated to/usr/local/php/5.4.45 under/usr/local/php/5.4.45.bak/bin.


And then test and kill the/usr/local/php/5.4.45.

And then it started to go wrong.


[Email protected] redis-2.2.8]#/usr/local/php/5.4.45.bak/bin/phpize

Cannot find build files at '/usr/local/php/5.4.45/lib/php/build '. Please check your PHP installation.


[Email protected] redis-2.2.8]#



The first reaction is to/usr/local/php/5.4.45.bak/bin/phpize the script.

[Email protected] redis-2.2.8]# cat/usr/local/php/5.4.45.bak/bin/phpize|less

#!/bin/sh


# Variable Declaration

prefix= '/usr/local/php/5.4.45 '

Datarootdir= '/usr/local/php/5.4.45/php '

exec_prefix= "' eval Echo ${prefix} '"

Phpdir= "' eval echo ${exec_prefix}/lib/php '/build"

Includedir= "' eval echo ${prefix}/include '/php"

Builddir= "' pwd '"

Sed= "/bin/sed"



Sure enough, he defined the path at the beginning and then went on to test the path.

I use the Replace but hint I have 3 columns have been modified

$SED \

-E "s#/usr/local/php/5.4.45.bak# $prefix #" \

< "$phpdir/phpize.m4" > configure.in

}

Phpize_autotools ()

{

$PHP _autoconf | | Exit 1

$PHP _autoheader | | Exit 1

}

# Main Script


Case "$" in

# Cleanup

--clean)

3 Substitutions on 3 lines


and then I searched for a little bit of this path.

[Email protected] 5.4.45.bak]# grep-rl "5.4.45".

./php/man/man8/php-fpm.8

./PHP/MAN/MAN1/PHP.1

./php/man/man1/phpize.1

./php/man/man1/php-config.1

./php/man/man1/phar.1

./bin/php

./bin/pear

./bin/phpize

grep:./bin/phar:no such file or directory

./bin/php-config

./bin/pecl

./bin/phar.phar

./bin/php-cgi

./bin/peardev

./sbin/php-fpm

./include/php/main/php_version.h

./include/php/main/build-defs.h

./etc/php-fpm.conf.default

./etc/pear.conf

./lib/php/extensions/no-debug-non-zts-20100525/redis.so

./lib/php/extensions/no-debug-non-zts-20100525/libevent.so

./lib/php/extensions/no-debug-non-zts-20100525/swoole.so

./lib/php/pearcmd.php

./lib/php/peclcmd.php

./lib/php/.registry/console_getopt.reg

./lib/php/.registry/pear.reg

./lib/php/.registry/xml_util.reg

./lib/php/.registry/archive_tar.reg

./lib/php/.registry/structures_graph.reg

[Email protected] 5.4.45.bak]#


I have a few more days.  I'm just a maintainer, isn't it? Bulk replacement? But I think it's OK to install it.

Version Upgrade for PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.