Saturday, August 29, 2009

Vim undo redo

SkyHi @ Saturday, August 29, 2009
VIM REFERENCE MANUAL by Bram Moolenaar



Undo and redo *undo-redo*

The basics are explained in section |02.5| of the user manual.

1. Undo and redo commands |undo-commands|
2. Two ways of undo |undo-two-ways|
3. Remarks about undo |undo-remarks|

==============================================================================

1. Undo and redo commands *undo-commands*


or *undo* ** *u*
u Undo [count] changes. {Vi: only one level}


*:u* *:un* *:undo*
:u[ndo] Undo one change. {Vi: only one level}


*CTRL-R*
CTRL-R Redo [count] changes which were undone. {Vi: redraw
screen}


*:red* *:redo* *redo*
:red[o] Redo one change which was undone. {Vi: no redo}


*U*
U Undo all latest changes on one line. {Vi: while not
moved off of it}

The last changes are remembered. You can use the undo and redo commands above
to revert the text to how it was before each change. You can also apply the
changes again, getting back the text before the undo.

The "U" command is treated by undo/redo just like any other command. Thus a
"u" command undoes a "U" command and a 'CTRL-R' command redoes it again. When
mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will
restore the situation of a line to before the previous "U" command. This may
be confusing. Try it out to get used to it.
The "U" command will always mark the buffer as changed. When "U" changes the
buffer back to how it was without changes, it is still considered changed.
Use "u" to undo changes until the buffer becomes unchanged.

==============================================================================

2. Two ways of undo *undo-two-ways*

How undo and redo commands work depends on the 'u' flag in 'cpoptions'.
There is the Vim way ('u' excluded) and the vi-compatible way ('u' included).
In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does
nothing (undoes an undo).

'u' excluded, the Vim way:
You can go back in time with the undo command. You can then go forward again
with the redo command. If you make a new change after the undo command,
the redo will not be possible anymore.

'u' included, the Vi-compatible way:
The undo command undoes the previous change, and also the previous undo command.
The redo command repeats the previous undo command. It does NOT repeat a
change command, use "." for that.

Examples Vim way Vi-compatible way
"uu" two times undo no-op
"u CTRL-R" no-op two times undo

Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this
is not Vi compatible. For example "dwdwu." in Vi deletes two
words, in Nvi it does nothing.

==============================================================================


Reference: http://www.vim.org/htmldoc/undo.html

Linux install and uninstall from source

SkyHi @ Saturday, August 29, 2009
< Installing software from source in Linux - 1.2 >

So you've downloaded a software package with tar.gz or tar.bz2 extension and have no idea what to do with it. Or perhaps you already know that it's most likely the source code of the program you want to install and you have to compile it, but don't know how. Don't worry, compiling and installing software from source in Linux isn't as hard as it may sound!

Author: Nana Långstedt < nana.langstedt at gmail.com >
tuXfile created: 13 July 2002
Last modified: 22 September 2005

contents

* The procedure
* Step 1. Unpacking
* Step 2. Configuring
* Step 3. Building
* Step 4. Installing
* Cleaning up the mess
* Uninstalling


back to

* Linux software
* Linux help
* tuXfiles home


< The procedure >

The installation procedure for software that comes in tar.gz and tar.bz2 packages isn't always the same, but usually it's like this:

# tar xvzf package.tar.gz (or tar xvjf package.tar.bz2)
# cd package
# ./configure
# make
# make install

If you're lucky, by issuing these simple commands you unpack, configure, compile, and install the software package and you don't even have to know what you're doing. However, it's healthy to take a closer look at the installation procedure and see what these steps mean.

< Step 1. Unpacking >

Maybe you've already noticed that the package containing the source code of the program has a tar.gz or a tar.bz2 extension. This means that the package is a compressed tar archive, also known as a tarball. When making the package, the source code and the other needed files were piled together in a single tar archive, hence the tar extension. After piling them all together in the tar archive, the archive was compressed with gzip, hence the gz extension.

Some people want to compress the tar archive with bzip2 instead of gzip. In these cases the package has a tar.bz2 extension. You install these packages exactly the same way as tar.gz packages, but you use a bit different command when unpacking.

It doesn't matter where you put the tarballs you download from the internet but I suggest creating a special directory for downloaded tarballs. In this tutorial I assume you keep tarballs in a directory called dls that you've created under your home directory. However, the dls directory is just an example. You can put your downloaded tar.gz or tar.bz2 software packages into any directory you want. In this example I assume your username is me and you've downloaded a package called pkg.tar.gz into the dls directory you've created (/home/me/dls).

Ok, finally on to unpacking the tarball. After downloading the package, you unpack it with this command:

me@puter: ~/dls$ tar xvzf pkg.tar.gz

As you can see, you use the tar command with the appropriate options (xvzf) for unpacking the tarball. If you have a package with tar.bz2 extension instead, you must tell tar that this isn't a gzipped tar archive. You do so by using the j option instead of z, like this:

me@puter: ~/dls$ tar xvjf pkg.tar.bz2

What happens after unpacking, depends on the package, but in most cases a directory with the package's name is created. The newly created directory goes under the directory where you are right now. To be sure, you can give the ls command:

me@puter: ~/dls$ ls
pkg pkg.tar.gz
me@puter: ~/dls$

In our example unpacking our package pkg.tar.gz did what expected and created a directory with the package's name. Now you must cd into that newly created directory:

me@puter: ~/dls$ cd pkg
me@puter: ~/dls/pkg$

Read any documentation you find in this directory, like README or INSTALL files, before continuing!

< Step 2. Configuring >

Now, after we've changed into the package's directory (and done a little RTFM'ing), it's time to configure the package. Usually, but not always (that's why you need to check out the README and INSTALL files) it's done by running the configure script.

You run the script with this command:

me@puter: ~/dls/pkg$ ./configure

When you run the configure script, you don't actually compile anything yet. configure just checks your system and assigns values for system-dependent variables. These values are used for generating a Makefile. The Makefile in turn is used for generating the actual binary.

When you run the configure script, you'll see a bunch of weird messages scrolling on your screen. This is normal and you shouldn't worry about it. If configure finds an error, it complains about it and exits. However, if everything works like it should, configure doesn't complain about anything, exits, and shuts up.

If configure exited without errors, it's time to move on to the next step.

< Step 3. Building >

It's finally time to actually build the binary, the executable program, from the source code. This is done by running the make command:

me@puter: ~/dls/pkg$ make

Note that make needs the Makefile for building the program. Otherwise it doesn't know what to do. This is why it's so important to run the configure script successfully, or generate the Makefile some other way.

When you run make, you'll see again a bunch of strange messages filling your screen. This is also perfectly normal and nothing you should worry about. This step may take some time, depending on how big the program is and how fast your computer is. If you're doing this on an old dementic rig with a snail processor, go grab yourself some coffee. At this point I usually lose my patience completely.

If all goes as it should, your executable is finished and ready to run after make has done its job. Now, the final step is to install the program.

< Step 4. Installing >

Now it's finally time to install the program. When doing this you must be root. If you've done things as a normal user, you can become root with the su command. It'll ask you the root password and then you're ready for the final step!

me@puter: ~/dls/pkg$ su
Password:
root@puter: /home/me/dls/pkg#

Now when you're root, you can install the program with the make install command:

root@puter: /home/me/dls/pkg# make install

Again, you'll get some weird messages scrolling on the screen. After it's stopped, congrats: you've installed the software and you're ready to run it!

Because in this example we didn't change the behavior of the configure script, the program was installed in the default place. In many cases it's /usr/local/bin. If /usr/local/bin (or whatever place your program was installed in) is already in your PATH, you can just run the program by typing its name.

And one more thing: if you became root with su, you'd better get back your normal user privileges before you do something stupid. Type exit to become a normal user again:

root@puter: /home/me/dls/pkg# exit
exit
me@puter: ~/dls/pkg$

< Cleaning up the mess >

I bet you want to save some disk space. If this is the case, you'll want to get rid of some files you don't need. When you ran make it created all sorts of files that were needed during the build process but are useless now and are just taking up disk space. This is why you'll want to make clean:

me@puter: ~/dls/pkg$ make clean

However, make sure you keep your Makefile. It's needed if you later decide to uninstall the program and want to do it as painlessly as possible!

< Uninstalling >

So, you decided you didn't like the program after all? Uninstalling the programs you've compiled yourself isn't as easy as uninstalling programs you've installed with a package manager, like rpm.

If you want to uninstall the software you've compiled yourself, do the obvious: do some old-fashioned RTFM'ig. Read the documentation that came with your software package and see if it says anything about uninstalling. If it doesn't, you can start pulling your hair out.

If you didn't delete your Makefile, you may be able to remove the program by doing a make uninstall:

root@puter: /home/me/dls/pkg# make uninstall

If you see weird text scrolling on your screen (but at this point you've probably got used to weird text filling the screen? :-) that's a good sign. If make starts complaining at you, that's a bad sign. Then you'll have to remove the program files manually.

If you know where the program was installed, you'll have to manually delete the installed files or the directory where your program is. If you have no idea where all the files are, you'll have to read the Makefile and see where all the files got installed, and then delete them.

Reference: http://www.tuxfiles.org/linuxhelp/softinstall.html

Friday, August 28, 2009

wget select files from a website

SkyHi @ Friday, August 28, 2009
Step 1:
[root@home php5.2.10]# cat phpfiles.rtf
08-Mar-2008 19:53 23K
[ ] php-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 1.2M
[ ] php-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 1.3M
[ ] php-PHPMailer-5.0.2-3.el5.remi.noarch.rpm 08-Aug-2009 10:28 74K
[ ] php-bcmath-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 34K
[ ] php-bcmath-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 34K
[ ] php-channel-ezc-1-1.el5.remi.noarch.rpm 19-Jul-2009 10:37 3.3K
[ ] php-channel-phing-1.0.0-6.el5.remi.noarch.rpm 19-Jul-2009 11:14 3.9K
[ ] php-channel-phpdb-1.0.0-5.el5.remi.noarch.rpm 19-Jul-2009 11:14 3.8K
[ ] php-channel-phpunit-1.0-3.el5.remi.noarch.rpm 19-Jul-2009 11:14 3.4K
[ ] php-channel-symfony-1.0.0-3.el5.remi.noarch.rpm 19-Jul-2009 11:14 3.5K
[ ] php-cli-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 2.4M
[ ] php-cli-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 2.5M
[ ] php-common-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 267K
[ ] php-common-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 591K
[ ] php-dba-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 41K
[ ] php-dba-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 41K
[ ] php-devel-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 582K
[ ] php-devel-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 620K
[ ] php-eaccelerator-0.9.5.2-2.el5.remi.i386.rpm 14-Apr-2008 12:14 137K
[ ] php-eaccelerator-0.9.6-0.2.rc1.el5.remi.i386.rpm 13-Aug-2009 20:07 100K
[ ] php-embedded-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 1.2M
[ ] php-embedded-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 1.3M
[ ] php-enchant-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 28K
[ ] php-ezc-Archive-1.3.3-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 607K
[ ] php-ezc-Authentication-1.3-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 620K
[ ] php-ezc-AuthenticationDatabaseTiein-1.1-1.el5.remi.noarch.rpm 24-Aug-2009 20:25 44K
[ ] php-ezc-Base-1.7-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 233K
[ ] php-ezc-Cache-1.4.1-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 768K
[ ] php-ezc-Configuration-1.3.3-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 447K
[ ] php-ezc-ConsoleTools-1.5.2-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 903K
[ ] php-ezc-Database-1.4.5-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 619K
[ ] php-ezc-Database-1.4.6-1.el5.remi.noarch.rpm 29-Jul-2009 08:36 619K
[ ] php-ezc-EventLog-1.4-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 254K
[ ] php-ezc-Feed-1.2.1-1.el5.remi.noarch.rpm 24-Aug-2009 20:25 588K
[ ] php-ezc-File-1.2-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 36K
[ ] php-ezc-Mail-1.6.3-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 1.1M
[ ] php-ezc-PersistentObject-1.6-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 1.1M
[ ] php-ezc-SystemInformation-1.0.7-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 141K
[ ] php-ezc-Template-1.4-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 8.0M
[ ] php-ezc-Webdav-1.1.1-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 2.7M
[ ] php-gd-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 124K
[ ] php-gd-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 114K
[ ] php-imap-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 54K
[ ] php-imap-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 52K
[ ] php-interbase-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 64K
[ ] php-interbase-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 67K
[ ] php-intl-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 72K
[ ] php-ldap-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 36K
[ ] php-ldap-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 38K
[ ] php-mbstring-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 1.1M
[ ] php-mbstring-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 1.1M
[ ] php-mcrypt-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 30K
[ ] php-mcrypt-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 32K
[ ] php-mhash-5.2.9-1.el5.remi.i386.rpm 27-Feb-2009 22:25 22K
[ ] php-mhash-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 23K
[ ] php-mssql-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 43K
[ ] php-mssql-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 44K
[ ] php-mysql-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 84K
[ ] php-mysql-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 85K
[ ] php-ncurses-5.2.9-1.el5.remi.i386.rpm 27-Feb-2009 22:25 40K
[ ] php-ncurses-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 41K
[ ] php-oci8-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 75K
[ ] php-oci8-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 89K
[ ] php-odbc-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 53K
[ ] php-odbc-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 53K
[ ] php-pdo-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 91K
[ ] php-pdo-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 93K
[ ] php-pear-1.8.0-2.el5.remi.1.noarch.rpm 11-Apr-2009 11:45 421K
[ ] php-pear-1.8.1-1.el5.remi.noarch.rpm 18-Apr-2009 16:58 419K
[ ] php-pear-Auth-1.6.1-9.el5.remi.noarch.rpm 19-Jul-2009 13:41 62K
[ ] php-pear-Auth-RADIUS-1.0.6-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 12K
[ ] php-pear-Auth-SASL-1.0.3-1.el5.remi.noarch.rpm 08-Aug-2009 10:28 11K
[ ] php-pear-Auth-radius-1.6.1-9.el5.remi.noarch.rpm 19-Jul-2009 13:41 5.3K
[ ] php-pear-Auth-samba-1.6.1-9.el5.remi.noarch.rpm 19-Jul-2009 13:41 4.9K
[ ] php-pear-Auth_HTTP-2.1.6-3.el5.remi.noarch.rpm 18-Aug-2009 17:53 12K
[ ] php-pear-Cache-1.5.5-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 37K
[ ] php-pear-Cache-Lite-1.7.4-1.el5.remi.noarch.rpm 12-Jul-2008 08:16 40K
[ ] php-pear-Cache-Lite-1.7.8-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 40K
[ ] php-pear-Config-1.10.11-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 35K
[ ] php-pear-Console-Color-1.0.2-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 8.8K
[ ] php-pear-Console-Table-1.1.3-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 15K
[ ] php-pear-Crypt-Blowfish-1.1.0-0.3.rc2.el5.remi.noarch.rpm 19-Jul-2009 13:41 22K
[ ] php-pear-Crypt-CHAP-1.0.1-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 9.5K
[ ] php-pear-Event-Dispatcher-1.1.0-1.el5.remi.noarch.rpm 29-Jul-2009 08:36 14K
[ ] php-pear-File-1.3.0-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 37K
[ ] php-pear-File-Bittorrent2-1.3.1-4.el5.remi.noarch.rpm 08-Aug-2009 10:28 77K
[ ] php-pear-HTML-QuickForm-advmultiselect-1.5.1-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 39K
[ ] php-pear-HTML-Table-1.8.2-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 23K
[ ] php-pear-HTML_Javascript-1.1.1-4.el5.remi.noarch.rpm 18-Aug-2009 17:53 13K
[ ] php-pear-HTTP-1.4.1-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 15K
[ ] php-pear-HTTP-Client-1.2.1-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 14K
[ ] php-pear-Log-1.11.4-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 56K
[ ] php-pear-Log-1.11.5-1.el5.remi.noarch.rpm 08-Aug-2009 10:28 56K
[ ] php-pear-MDB2-Driver-mysqli-1.4.1-4.el5.remi.noarch.rpm 19-Jul-2009 13:41 42K
[ ] php-pear-Mail-Mime-1.5.2-4.el5.remi.noarch.rpm 02-Dec-2008 18:36 31K
[ ] php-pear-Mail-Mime-1.5.2-5.el5.remi.noarch.rpm 19-Jul-2009 13:41 31K
[ ] php-pear-Mail-mimeDecode-1.5.0-3.el5.remi.noarch.rpm 02-Dec-2008 18:36 13K
[ ] php-pear-Mail-mimeDecode-1.5.0-4.el5.remi.noarch.rpm 19-Jul-2009 13:41 13K
[ ] php-pear-Net-DNS-1.0.1-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 31K
[ ] php-pear-Net-FTP-1.3.7-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 38K
[ ] php-pear-Net-IPv4-1.3.0-3.el5.remi.noarch.rpm 19-Jul-2009 13:41 8.1K
[ ] php-pear-Net-Ping-2.4.4-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 14K
[ ] php-pear-Net-SMTP-1.3.3-1.el5.remi.noarch.rpm 19-Jul-2009 13:41 17K
[ ] php-pear-Net-Sieve-1.1.6-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 18K
[ ] php-pear-Net-Sieve-1.1.7-1.el5.remi.noarch.rpm 29-Jul-2009 08:36 18K
[ ] php-pear-Net-Socket-1.0.9-2.el5.remi.noarch.rpm 19-Jul-2009 13:41 10K
[ ] php-pear-PEAR-Command-Packaging-0.2.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 21K
[ ] php-pear-PHP-CodeSniffer-1.1.0-1.el5.remi.noarch.rpm 19-Jul-2009 15:37 298K
[ ] php-pear-PHP-CompatInfo-1.8.1-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 166K
[ ] php-pear-PHPUnit-3.3.16-1.el5.remi.noarch.rpm 19-Jul-2009 15:37 323K
[ ] php-pear-SOAP-0.12.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 78K
[ ] php-pear-Services-Weather-1.4.4-1.el5.remi.noarch.rpm 19-Jul-2009 15:37 57K
[ ] php-pear-Structures-DataGrid-0.9.0-4.el5.remi.noarch.rpm 19-Jul-2009 15:37 54K
[ ] php-pear-Structures-DataGrid-DataSource-Array-0.1.4-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 7.3K
[ ] php-pear-Structures-DataGrid-DataSource-DataObject-0.2.1-2.el5.remi.noarch.rpm19-Jul-2009 15:37 11K
[ ] php-pear-Structures-DataGrid-DataSource-MDB2-0.1.11-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 7.4K
[ ] php-pear-Structures-DataGrid-Renderer-Pager-0.1.3-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 8.1K
[ ] php-pear-Structures-DataGrid-Renderer-Smarty-0.1.4-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 9.7K
[ ] php-pear-Validate-Finance-CreditCard-0.5.3-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 10K
[ ] php-pear-XML-Beautifier-1.2.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 17K
[ ] php-pear-XML-Parser-1.3.2-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 22K
[ ] php-pear-creole-1.1.0-6.el5.remi.noarch.rpm 19-Jul-2009 15:37 105K
[ ] php-pear-pake-1.1.4-4.el5.remi.noarch.rpm 19-Jul-2009 15:37 30K
[ ] php-pear-phing-2.3.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 435K
[ ] php-pear-propel_generator-1.3.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 190K
[ ] php-pear-propel_runtime-1.3.0-2.el5.remi.noarch.rpm 19-Jul-2009 15:37 64K
[ ] php-pecl-Fileinfo-1.0.4-3.el5.remi.i386.rpm 16-Jun-2007 23:09 11K
[ ] php-pecl-apc-3.1.2-2.el5.remi.1.i386.rpm 02-Jul-2009 22:28 86K
[ ] php-pecl-apc-3.1.3p1-1.el5.remi.i386.rpm 15-Aug-2009 07:55 101K
[ ] php-pecl-geoip-1.0.7-2.el5.remi.i386.rpm 03-Jul-2009 18:42 13K
[ ] php-pecl-imagick-2.2.2-3.el5.remi.1.i386.rpm 02-Jul-2009 22:28 87K
[ ] php-pecl-imagick-2.3.0-1.el5.remi.i386.rpm 24-Aug-2009 18:56 90K
[ ] php-pecl-lzf-1.5.2-3.el5.remi.i386.rpm 03-Jul-2009 18:42 9.0K
[ ] php-pecl-mailparse-2.1.1-5.el5.remi.i386.rpm 16-Jun-2007 15:36 27K
[ ] php-pecl-mailparse-2.1.5-2.el5.remi.1.i386.rpm 02-Jul-2009 22:28 34K
[ ] php-pecl-memcache-3.0.4-1.el5.remi.i386.rpm 28-Feb-2009 18:07 63K
[ ] php-pecl-memcache-3.0.4-2.el5.remi.1.i386.rpm 02-Jul-2009 22:28 64K
[ ] php-pecl-memcached-0.2.0-1.el5.remi.i386.rpm 29-Jun-2009 18:09 29K
[ ] php-pecl-memcached-0.2.0-2.el5.remi.1.i386.rpm 02-Jul-2009 22:28 29K
[ ] php-pecl-ncurses-1.0.0-4.el5.remi.1.i386.rpm 02-Jul-2009 22:28 28K
[ ] php-pecl-pdflib-2.1.6-1.el5.remi.i386.rpm 21-Mar-2009 16:50 44K
[ ] php-pecl-pdflib-2.1.7-2.el5.remi.1.i386.rpm 02-Jul-2009 22:30 42K
[ ] php-pecl-phar-1.2.2-1.el5.remi.i386.rpm 27-Oct-2007 10:30 62K
[ ] php-pecl-radius-1.2.5-6.el5.remi.i386.rpm 03-Jul-2009 18:42 33K
[ ] php-pecl-ssh2-0.11.0-1.el5.remi.i386.rpm 09-Jun-2009 19:10 29K
[ ] php-pecl-ssh2-0.11.0-3.el5.remi.1.i386.rpm 02-Jul-2009 22:28 29K
[ ] php-pecl-xdebug-2.0.3-4.el5.remi.i386.rpm 12-Dec-2008 18:20 151K
[ ] php-pecl-xdebug-2.0.5-1.el5.remi.i386.rpm 14-Jul-2009 09:30 151K
[ ] php-pgsql-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 71K
[ ] php-pgsql-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 72K
[ ] php-process-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 37K
[ ] php-process-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 40K
[ ] php-pspell-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 26K
[ ] php-pspell-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 28K
[ ] php-recode-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 22K
[ ] php-recode-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 25K
[ ] php-snmp-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 29K
[ ] php-snmp-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 32K
[ ] php-soap-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 145K
[ ] php-soap-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 147K
[ ] php-suhosin-0.9.24-1.el5.remi.i386.rpm 11-May-2008 11:01 74K
[ ] php-suhosin-0.9.27-1.el5.remi.i386.rpm 18-Sep-2008 19:21 76K
[ ] php-tidy-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 34K
[ ] php-tidy-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 37K
[ ] php-xml-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 115K
[ ] php-xml-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 114K
[ ] php-xmlrpc-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 57K
[ ] php-xmlrpc-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 54K
[ ] php-zts-5.2.10-1.el5.remi.i386.rpm 21-Jun-2009 11:46 1.3M
[ ] php-zts-5.3.0-2.el5.remi.2.i386.rpm 19-Jul-2009 18:08 1.3M
[ ] phpMyAdmin-3.2.0.1-1.el5.remi.noarch.rpm 30-Jun-2009 22:44 4.1M
[ ] phpMyAdmin-3.2.1-1.el5.remi.noarch.rpm 10-Aug-2009 19:14 4.2M
[ ] phpcs-1.1.0-1.el5.remi.noarch.rpm


Step 2:
[root@home php5.2.10]# awk '{ print $3 }' phpfiles.rtf > phpfiles.rtf.1

[root@home php5.2.10]# cat phpfiles.rtf.1
php-5.2.10-1.el5.remi.i386.rpm
php-5.3.0-2.el5.remi.2.i386.rpm
php-PHPMailer-5.0.2-3.el5.remi.noarch.rpm
php-bcmath-5.2.10-1.el5.remi.i386.rpm
php-bcmath-5.3.0-2.el5.remi.2.i386.rpm
php-channel-ezc-1-1.el5.remi.noarch.rpm
php-channel-phing-1.0.0-6.el5.remi.noarch.rpm
php-channel-phpdb-1.0.0-5.el5.remi.noarch.rpm
php-channel-phpunit-1.0-3.el5.remi.noarch.rpm
php-channel-symfony-1.0.0-3.el5.remi.noarch.rpm
php-cli-5.2.10-1.el5.remi.i386.rpm
php-cli-5.3.0-2.el5.remi.2.i386.rpm
php-common-5.2.10-1.el5.remi.i386.rpm
php-common-5.3.0-2.el5.remi.2.i386.rpm
php-dba-5.2.10-1.el5.remi.i386.rpm
php-dba-5.3.0-2.el5.remi.2.i386.rpm
php-devel-5.2.10-1.el5.remi.i386.rpm
php-devel-5.3.0-2.el5.remi.2.i386.rpm
php-eaccelerator-0.9.5.2-2.el5.remi.i386.rpm
php-eaccelerator-0.9.6-0.2.rc1.el5.remi.i386.rpm
php-embedded-5.2.10-1.el5.remi.i386.rpm
php-embedded-5.3.0-2.el5.remi.2.i386.rpm
php-enchant-5.3.0-2.el5.remi.2.i386.rpm
php-ezc-Archive-1.3.3-1.el5.remi.noarch.rpm
php-ezc-Authentication-1.3-1.el5.remi.noarch.rpm
php-ezc-AuthenticationDatabaseTiein-1.1-1.el5.remi.noarch.rpm
php-ezc-Base-1.7-1.el5.remi.noarch.rpm
php-ezc-Cache-1.4.1-1.el5.remi.noarch.rpm
php-ezc-Configuration-1.3.3-1.el5.remi.noarch.rpm
php-ezc-ConsoleTools-1.5.2-1.el5.remi.noarch.rpm
php-ezc-Database-1.4.5-1.el5.remi.noarch.rpm
php-ezc-Database-1.4.6-1.el5.remi.noarch.rpm
php-ezc-EventLog-1.4-1.el5.remi.noarch.rpm
php-ezc-Feed-1.2.1-1.el5.remi.noarch.rpm
php-ezc-File-1.2-2.el5.remi.noarch.rpm
php-ezc-Mail-1.6.3-1.el5.remi.noarch.rpm
php-ezc-PersistentObject-1.6-1.el5.remi.noarch.rpm
php-ezc-SystemInformation-1.0.7-1.el5.remi.noarch.rpm
php-ezc-Template-1.4-1.el5.remi.noarch.rpm
php-ezc-Webdav-1.1.1-1.el5.remi.noarch.rpm
php-gd-5.2.10-1.el5.remi.i386.rpm
php-gd-5.3.0-2.el5.remi.2.i386.rpm
php-imap-5.2.10-1.el5.remi.i386.rpm
php-imap-5.3.0-2.el5.remi.2.i386.rpm
php-interbase-5.2.10-1.el5.remi.i386.rpm
php-interbase-5.3.0-2.el5.remi.2.i386.rpm
php-intl-5.3.0-2.el5.remi.2.i386.rpm
php-ldap-5.2.10-1.el5.remi.i386.rpm
php-ldap-5.3.0-2.el5.remi.2.i386.rpm
php-mbstring-5.2.10-1.el5.remi.i386.rpm
php-mbstring-5.3.0-2.el5.remi.2.i386.rpm
php-mcrypt-5.2.10-1.el5.remi.i386.rpm
php-mcrypt-5.3.0-2.el5.remi.2.i386.rpm
php-mhash-5.2.9-1.el5.remi.i386.rpm
php-mhash-5.2.10-1.el5.remi.i386.rpm
php-mssql-5.2.10-1.el5.remi.i386.rpm
php-mssql-5.3.0-2.el5.remi.2.i386.rpm
php-mysql-5.2.10-1.el5.remi.i386.rpm
php-mysql-5.3.0-2.el5.remi.2.i386.rpm
php-ncurses-5.2.9-1.el5.remi.i386.rpm
php-ncurses-5.2.10-1.el5.remi.i386.rpm
php-oci8-5.2.10-1.el5.remi.i386.rpm
php-oci8-5.3.0-2.el5.remi.2.i386.rpm
php-odbc-5.2.10-1.el5.remi.i386.rpm
php-odbc-5.3.0-2.el5.remi.2.i386.rpm
php-pdo-5.2.10-1.el5.remi.i386.rpm
php-pdo-5.3.0-2.el5.remi.2.i386.rpm
php-pear-1.8.0-2.el5.remi.1.noarch.rpm
php-pear-1.8.1-1.el5.remi.noarch.rpm
php-pear-Auth-1.6.1-9.el5.remi.noarch.rpm
php-pear-Auth-RADIUS-1.0.6-3.el5.remi.noarch.rpm
php-pear-Auth-SASL-1.0.3-1.el5.remi.noarch.rpm
php-pear-Auth-radius-1.6.1-9.el5.remi.noarch.rpm
php-pear-Auth-samba-1.6.1-9.el5.remi.noarch.rpm
php-pear-Auth_HTTP-2.1.6-3.el5.remi.noarch.rpm
php-pear-Cache-1.5.5-2.el5.remi.noarch.rpm
php-pear-Cache-Lite-1.7.4-1.el5.remi.noarch.rpm
php-pear-Cache-Lite-1.7.8-1.el5.remi.noarch.rpm
php-pear-Config-1.10.11-3.el5.remi.noarch.rpm
php-pear-Console-Color-1.0.2-3.el5.remi.noarch.rpm
php-pear-Console-Table-1.1.3-2.el5.remi.noarch.rpm
php-pear-Crypt-Blowfish-1.1.0-0.3.rc2.el5.remi.noarch.rpm
php-pear-Crypt-CHAP-1.0.1-3.el5.remi.noarch.rpm
php-pear-Event-Dispatcher-1.1.0-1.el5.remi.noarch.rpm
php-pear-File-1.3.0-2.el5.remi.noarch.rpm
php-pear-File-Bittorrent2-1.3.1-4.el5.remi.noarch.rpm
php-pear-HTML-QuickForm-advmultiselect-1.5.1-1.el5.remi.noarch.rpm
php-pear-HTML-Table-1.8.2-2.el5.remi.noarch.rpm
php-pear-HTML_Javascript-1.1.1-4.el5.remi.noarch.rpm
php-pear-HTTP-1.4.1-3.el5.remi.noarch.rpm
php-pear-HTTP-Client-1.2.1-2.el5.remi.noarch.rpm
php-pear-Log-1.11.4-1.el5.remi.noarch.rpm
php-pear-Log-1.11.5-1.el5.remi.noarch.rpm
php-pear-MDB2-Driver-mysqli-1.4.1-4.el5.remi.noarch.rpm
php-pear-Mail-Mime-1.5.2-4.el5.remi.noarch.rpm
php-pear-Mail-Mime-1.5.2-5.el5.remi.noarch.rpm
php-pear-Mail-mimeDecode-1.5.0-3.el5.remi.noarch.rpm
php-pear-Mail-mimeDecode-1.5.0-4.el5.remi.noarch.rpm
php-pear-Net-DNS-1.0.1-1.el5.remi.noarch.rpm
php-pear-Net-FTP-1.3.7-2.el5.remi.noarch.rpm
php-pear-Net-IPv4-1.3.0-3.el5.remi.noarch.rpm
php-pear-Net-Ping-2.4.4-2.el5.remi.noarch.rpm
php-pear-Net-SMTP-1.3.3-1.el5.remi.noarch.rpm
php-pear-Net-Sieve-1.1.6-2.el5.remi.noarch.rpm
php-pear-Net-Sieve-1.1.7-1.el5.remi.noarch.rpm
php-pear-Net-Socket-1.0.9-2.el5.remi.noarch.rpm
php-pear-PEAR-Command-Packaging-0.2.0-2.el5.remi.noarch.rpm
php-pear-PHP-CodeSniffer-1.1.0-1.el5.remi.noarch.rpm
php-pear-PHP-CompatInfo-1.8.1-2.el5.remi.noarch.rpm
php-pear-PHPUnit-3.3.16-1.el5.remi.noarch.rpm
php-pear-SOAP-0.12.0-2.el5.remi.noarch.rpm
php-pear-Services-Weather-1.4.4-1.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-0.9.0-4.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-DataSource-Array-0.1.4-2.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-DataSource-DataObject-0.2.1-2.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-DataSource-MDB2-0.1.11-2.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-Renderer-Pager-0.1.3-2.el5.remi.noarch.rpm
php-pear-Structures-DataGrid-Renderer-Smarty-0.1.4-2.el5.remi.noarch.rpm
php-pear-Validate-Finance-CreditCard-0.5.3-2.el5.remi.noarch.rpm
php-pear-XML-Beautifier-1.2.0-2.el5.remi.noarch.rpm
php-pear-XML-Parser-1.3.2-2.el5.remi.noarch.rpm
php-pear-creole-1.1.0-6.el5.remi.noarch.rpm
php-pear-pake-1.1.4-4.el5.remi.noarch.rpm
php-pear-phing-2.3.0-2.el5.remi.noarch.rpm
php-pear-propel_generator-1.3.0-2.el5.remi.noarch.rpm
php-pear-propel_runtime-1.3.0-2.el5.remi.noarch.rpm
php-pecl-Fileinfo-1.0.4-3.el5.remi.i386.rpm
php-pecl-apc-3.1.2-2.el5.remi.1.i386.rpm
php-pecl-apc-3.1.3p1-1.el5.remi.i386.rpm
php-pecl-geoip-1.0.7-2.el5.remi.i386.rpm
php-pecl-imagick-2.2.2-3.el5.remi.1.i386.rpm
php-pecl-imagick-2.3.0-1.el5.remi.i386.rpm
php-pecl-lzf-1.5.2-3.el5.remi.i386.rpm
php-pecl-mailparse-2.1.1-5.el5.remi.i386.rpm
php-pecl-mailparse-2.1.5-2.el5.remi.1.i386.rpm
php-pecl-memcache-3.0.4-1.el5.remi.i386.rpm
php-pecl-memcache-3.0.4-2.el5.remi.1.i386.rpm
php-pecl-memcached-0.2.0-1.el5.remi.i386.rpm
php-pecl-memcached-0.2.0-2.el5.remi.1.i386.rpm
php-pecl-ncurses-1.0.0-4.el5.remi.1.i386.rpm
php-pecl-pdflib-2.1.6-1.el5.remi.i386.rpm
php-pecl-pdflib-2.1.7-2.el5.remi.1.i386.rpm
php-pecl-phar-1.2.2-1.el5.remi.i386.rpm
php-pecl-radius-1.2.5-6.el5.remi.i386.rpm
php-pecl-ssh2-0.11.0-1.el5.remi.i386.rpm
php-pecl-ssh2-0.11.0-3.el5.remi.1.i386.rpm
php-pecl-xdebug-2.0.3-4.el5.remi.i386.rpm
php-pecl-xdebug-2.0.5-1.el5.remi.i386.rpm
php-pgsql-5.2.10-1.el5.remi.i386.rpm
php-pgsql-5.3.0-2.el5.remi.2.i386.rpm
php-process-5.2.10-1.el5.remi.i386.rpm
php-process-5.3.0-2.el5.remi.2.i386.rpm
php-pspell-5.2.10-1.el5.remi.i386.rpm
php-pspell-5.3.0-2.el5.remi.2.i386.rpm
php-recode-5.2.10-1.el5.remi.i386.rpm
php-recode-5.3.0-2.el5.remi.2.i386.rpm
php-snmp-5.2.10-1.el5.remi.i386.rpm
php-snmp-5.3.0-2.el5.remi.2.i386.rpm
php-soap-5.2.10-1.el5.remi.i386.rpm
php-soap-5.3.0-2.el5.remi.2.i386.rpm
php-suhosin-0.9.24-1.el5.remi.i386.rpm
php-suhosin-0.9.27-1.el5.remi.i386.rpm
php-tidy-5.2.10-1.el5.remi.i386.rpm
php-tidy-5.3.0-2.el5.remi.2.i386.rpm
php-xml-5.2.10-1.el5.remi.i386.rpm
php-xml-5.3.0-2.el5.remi.2.i386.rpm
php-xmlrpc-5.2.10-1.el5.remi.i386.rpm
php-xmlrpc-5.3.0-2.el5.remi.2.i386.rpm
php-zts-5.2.10-1.el5.remi.i386.rpm
php-zts-5.3.0-2.el5.remi.2.i386.rpm
phpMyAdmin-3.2.0.1-1.el5.remi.noarch.rpm
phpMyAdmin-3.2.1-1.el5.remi.noarch.rpm
phpcs-1.1.0-1.el5.remi.noarch.rpm


[root@home php5.2.10]# cat script1.sh
#!/bin/bash
#
for i in `cat phpfiles.rtf.1`
do
wget "http://rpms.famillecollet.com/el5.i386/$i"
done

Centos * HowTos * PHP 5.1 To 5.2

SkyHi @ Friday, August 28, 2009
Summary

This guide describes how to upgrade the standard PHP 5.1.x packages in CentOS 5.x 32-bit to the current development versions 5.2.x. These instructions were created using CentOS 5.3 32-bit and with the following PHP packages installed:

# rpm -qa |grep php

php-common-5.1.6-15.el5.i386
php-cli-5.1.6-15.el5.i386
php-5.1.6-15.el5.i386
php-pdo-5.1.6-15.el5.i386
php-bcmath-5.1.6-15.el5.i386
php-ldap-5.1.6-15.el5.i386
php-devel-5.1.6-15.el5.i386
php-gd-5.1.6-15.el5.i386
php-xml-5.1.6-15.el5.i386
php-mbstring-5.1.6-15.el5.i386
php-mysql-5.1.6-15.el5.i386
php-dba-5.1.6-15.el5.i386

As long as you're using the standard PHP packages on your CentOS server you won't need to do anything extra. If you're using extra PHP packages that aren't part of the standard CentOS repositories (like php-mcrypt) you'll have to remove them or find updated versions of them.

Add the development repositories

First thing we need to do is add the development repositories to yum. When we add the development repository we're going to configure it so it only pulls PHP packages. To start we'll need create a new yum repository configuration file (use your favorite editor):

# /etc/yum.repos.d/CentOS-Testing.repo

Copy/paste the following into this file:

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.
[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

Save and close the file and you're done.

Update PHP packages

Before updating your PHP packages you'll want to get a list of what you currently have installed. To get a list of current PHP packages run the following:

# rpm -qa |grep php

Now you can use yum to update the PHP packages on your system:

# yum update

You should be shown a list of packages that are going to be updated. Compare it to the list of PHP packages on your system. Note any packages that are not in the list. You'll need to remove these packages or find updates for them because they won't work after you update to PHP 5.2.x. If that is acceptable type "y" to continue and let yum update the packages.

Once yum has completed restart Apache:

# service httpd restart

To verify the update is working create a simple testing.php in your www directory with the following source code:

phpinfo();
?>

and open it in a web browser. The new PHP version should be reflected at the top of the page.

Conclusion

You should now have PHP 5.2.6 running on CentOS 5.3 32-bit.

# rpm -qa |grep php

php-cli-5.2.6-2.el5s2
php-mbstring-5.2.6-2.el5s2
php-devel-5.2.6-2.el5s2
php-pdo-5.2.6-2.el5s2
php-gd-5.2.6-2.el5s2
php-dba-5.2.6-2.el5s2
php-common-5.2.6-2.el5s2
php-bcmath-5.2.6-2.el5s2
php-xml-5.2.6-2.el5s2
php-pear-1.5.1-2.el5s2
php-ldap-5.2.6-2.el5s2
php-5.2.6-2.el5s2
php-mysql-5.2.6-2.el5s2


# php -v

PHP 5.2.6 (cli) (built: Sep 15 2008 20:42:05)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Note: If your "php -v" output returns errors about PDO or JSON click here

Extras

Updating/Installing mcrypt

If you have php-mcrypt for PHP 5.1.x installed you'll want to remove it:

Note: Your version number maybe different. Alter below command accordingly.

rpm -e php-mcrypt-5.1.6-15.el5.centos.1

Download php-mcrypt for PHP 5.2.x and install it. You can find a 32-bit php-mcrypt package here FedoraJunkies.

Note: You'll notice the "--nodeps" flag in the example. When you try to install php-mcrypt without it you get an error that php-common-5.2.6-2.el5s2 is missing even though it is installed.

wget -c http://sourcemirrors.org/scotth/centos/5/php/php-mcrypt-5.2.6-2.i386.rpm
rpm -i --nodeps php-mcrypt-5.2.6-2.i386.rpm

Restart Apache and you should now see mcrypt information on your testing.php page.

JSON and PDO being loaded twice

When you run the command "php -v" you might see the following errors:

# php -v

PHP Warning: Module 'json' already loaded in Unknown on line 0
PHP Warning: Module 'PDO' already loaded in Unknown on line 0
PHP 5.2.6 (cli) (built: Sep 15 2008 20:42:05)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

This is caused by the following two lines in the /etc/php.ini file:

; Extension JSON
extension=json.so

; Extension PDO
extension=pdo.so

Comment out these lines by adding a ";" in front of "extension=". These two modules are already loaded via these two files:

/etc/php.d/json.ini
/etc/php.d/pdo.ini

Reference: http://wiki.centos.org/HowTos/PHP_5.1_To_5.2

PHP 5.3 on CentOS 5

SkyHi @ Friday, August 28, 2009
My previous articles on installing PHP on CentOS dealt with installing PHP 5.2.6. I have found this to have some bugs that kill the process without error information. One bug I found, which was on an x86_64 server, was that converting an object to a string did this.
So, I have compiled the latest PHP version, 5.2.10 5.3.0 5.3.3, and put it in my own repository for easy installation. I have compiled it for CentOS 5 i386 and x86_64, and provided the source RPMS in the repo, if anyone wants to compile it for another OS or architecture.
Update 2009-07-03 – I updated the version to PHP 5.3, which was released a few days before. This includes many new features such as closures, namespaces, and packaged scripts in phar files, which I’ll blog about soon. Check out PHP changelog for more details.
Update 2009-09-01 – Added a note about deprecated errors, and how to silence them. Also I have included a tip that might help those of you struggling to install.
Update 2010-03-03 – I’ve added both apc 3.1.3p1 beta (php-pecl-apc in yum) and eAccelerator 0.9.6 (php-eaccelerator in yum) RPMs to the repository, they are compiled for (and work on) php 5.3.x

I have also included the same php extensions I mentioned in my other article, php-mcrypt, php-mhash (in PHP 5.2), php-mssql and php-tidy
To install, first you must tell rpm to accept rpm’s signed by me, then add the yum repository information to yum:
rpm -ivh http://repo.webtatic.com/yum/centos/5/`uname -i`/webtatic-release-5-0.noarch.rpm
Now you can install php by doing:
yum --enablerepo=webtatic install php
Or update an existing installation of php, which will also update all of the other php modules installed:
yum --enablerepo=webtatic update php
If this does not work correctly, try disabling all other repositories while installing/updating, by adding the –disablerepo=* option. This will stop other dependencies from being installed, so you may want to install them first.
yum --disablerepo=* --enablerepo=webtatic update php

“Depsolving” problems

If you get depsolving problems when updating, you may have currently installed some extensions that have been removed, e.g. php-mhash, php-ncurses.
You will need to remove them before upgrading.
yum remove php-mhash php-ncurses

Deprecated Errors

Once you are running the new version, you may get “deprecated” errors in your error logs. This isn’t bad, it just means to tell you that some of the functions you are using are no longer prefered, and may be removed in a future major release. An example of this is the ereg functions. Preg functions are prefered over these, as they are much faster and more powerful, and in all cases do at least the same thing.
If upgrading the functions are not an option, and you would like to hide the deprecated errors from your error log, for example on a production server, just edit your /etc/php.ini file, find the line:
error_reporting  =  E_ALL
and replace to:
error_reporting  =  E_ALL & ~E_DEPRECATED

PHP 5.2.14

I am also maintaining a PHP 5.2.14 release, so should you prefer to install that (for reasons like incompatibilities or testing), you can force it to install that instead by doing:
yum --enablerepo=webtatic --exclude=php*5.3* update php
Or you can add to the /etc/yum.repos.d/webtatic.repo the line:
exclude=php*5.3*

References:
http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/

Blogger

SkyHi @ Friday, August 28, 2009
http://blog.ucvhost.com/?cat=37

Cent os php source rpm 5.2

SkyHi @ Friday, August 28, 2009
Here at EchoDitto, most of our servers are running CentOS Linux, which is a 100% binary-compatible version of the industry standard Red Hat Enterprise Linux (RHEL) without any of the fees. The problem with RHEL/CentOS is that they shipped with PHP 5.1.6, and as of this writing PHP is at 5.2.9. That's not a big deal, being a minor point revision behind, until you come across an application or module that needs a minimum of version 5.2. The last thing I want to do is install packages from a third-party or build it from source and risk breaking other packages. So what's the answer? Building it from the source rpm. There's no better way to keep the system free of third-party packages but also up to date.

Why source RPMs and not the source from PHP? Building a source RPM is the same procedure used to build the packages that Red Hat creates, and includes the libraries and dependencies and sub-packages that you would normally get from Red Hat directly. It will also include all of the same build flags in your new version that were available in the older package, meaning your PHP scripts won't suddenly break. This ultimately ensures binary compatibility and the ability to easily upgrade if Red Hat or CentOS were to release a package newer than yours.

Sure, you could enable the CentOS Testing repository, but with all of the warnings about packages breaking your system, and configuring yum to only update PHP and not mess up mysql or Apache, I'd rather build and install only the packages that I need without worrying about breaking other packages. Want PHP 5.2 on your CentOS or RHEL server? Follow along.

1. Start by downloading the latest PHP 5.2 source RPM from the aforementioned CentOS Testing repository from http://dev.centos.org/centos/5/testing/SRPMS/. As of this writing, they're at php-5.2.6-2. Why aren't we using the 5.1.6 source? The source RPM for 5.2.6 includes the latest patches from Red Hat that you can normally only get from being a part of the non-free Red Hat Network.

I'll assume you're running as root for this guide. Download the source RPM with wget

# wget http://dev.centos.org/centos/5/testing/SRPMS/php-5.2.6-2.el5s2.src.rpm

2. Install the source RPM

# rpm -ivh php-5.2.6-2.el5s2.src.rpm

3. If you get an error and the install fails, you may need to manually create the SOURCES directory and install again

# mkdir -p /usr/src/redhat/SOURCES
# rpm -ivh php-5.2.6-2.el5s2.src.rpm

4. Download the latest stable release of PHP from the php.net download page and save it in the SOURCES folder. Change the version number to the latest version if needed.

# cd /usr/src/redhat/SOURCES
# wget http://us3.php.net/get/php-5.2.9.tar.gz/from/us.php.net/

5. In the SPECS folder, copy the original php.spec file in case you make mistakes or wish to build 5.2.6.

# cd /usr/src/redhat/SPECS
# cp php.spec php526.spec

6. Edit php.spec and change the version and revision numbers to be 5.2.9 (or later) and the revision to 1 since this is your first build.

Summary: The PHP HTML-embedded scripting language
Name: php
Version: 5.2.9
Release: 1%{?dist}
License: PHP
Group: Development/Languages
URL: http://www.php.net/

7. Make sure you have the Development Tools group install for rpmbuild if you haven't already done so.

# yum groupinstall "Development Tools"

8. Try and build the spec file to see if you are missing any packages. For this tutorial, I am running from the minimal package set.

# rpmbuild -ba php.spec
cat: /usr/include/httpd/.mmn: No such file or directory
error: Failed build dependencies:
bzip2-devel is needed by php-5.2.9-1.i386
curl-devel >= 7.9 is needed by php-5.2.9-1.i386
db4-devel is needed by php-5.2.9-1.i386
expat-devel is needed by php-5.2.9-1.i386
gmp-devel is needed by php-5.2.9-1.i386
aspell-devel >= 0.50.0 is needed by php-5.2.9-1.i386
httpd-devel >= 2.0.46-1 is needed by php-5.2.9-1.i386
libjpeg-devel is needed by php-5.2.9-1.i386
libpng-devel is needed by php-5.2.9-1.i386
pam-devel is needed by php-5.2.9-1.i386
openssl-devel is needed by php-5.2.9-1.i386
sqlite-devel >= 3.0.0 is needed by php-5.2.9-1.i386
zlib-devel is needed by php-5.2.9-1.i386
pcre-devel >= 6.6 is needed by php-5.2.9-1.i386
readline-devel is needed by php-5.2.9-1.i386
krb5-devel is needed by php-5.2.9-1.i386
libc-client-devel is needed by php-5.2.9-1.i386
cyrus-sasl-devel is needed by php-5.2.9-1.i386
openldap-devel is needed by php-5.2.9-1.i386
mysql-devel >= 4.1.0 is needed by php-5.2.9-1.i386
postgresql-devel is needed by php-5.2.9-1.i386
unixODBC-devel is needed by php-5.2.9-1.i386
libxml2-devel is needed by php-5.2.9-1.i386
net-snmp-devel is needed by php-5.2.9-1.i386
libxslt-devel >= 1.0.18-1 is needed by php-5.2.9-1.i386
libxml2-devel >= 2.4.14-1 is needed by php-5.2.9-1.i386
ncurses-devel is needed by php-5.2.9-1.i386
gd-devel is needed by php-5.2.9-1.i386
freetype-devel is needed by php-5.2.9-1.i386

9. Install any required packages with yum. If any of these packages have other dependencies they will be downloaded as well. This might take a while.

# yum install bzip2-devel curl-devel db4-devel expat-devel gmp-devel aspell-devel \
httpd-devel libjpeg-devel libpng-devel pam-devel openssl-devel sqlite-devel zlib-devel \
pcre-devel readline-devel krb5-devel libc-client-devel cyrus-sasl-devel openldap-devel \
mysql-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel \
libxml2-devel ncurses-devel gd-devel freetype-devel

10. Try and build the spec file again to see if any patches fail to load properly. This usually happens if a patch has been rolled into the mainline PHP project and is no longer needed.

# rpmbuild -ba php.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.81391
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf php-5.2.9
+ /bin/gzip -dc /usr/src/redhat/SOURCES/php-5.2.9.tar.gz
+ tar -xf -
+ STATUS=0
... output snipped ...
Patch #32 (php-5.2.5-systzdata.patch):
+ patch -p1 -b --suffix .systzdata -s
+ echo 'Patch #50 (php-5.2.4-tests-dashn.patch):'
Patch #50 (php-5.2.4-tests-dashn.patch):
+ patch -p1 -b --suffix .tests-dashn -s
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored -- saving rejects to file ext/standard/tests/file/bug26615.phpt.rej
1 out of 1 hunk FAILED -- saving rejects to file ext/standard/tests/file/proc_open01.phpt.rej
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored -- saving rejects to file ext/standard/tests/file/bug26938.phpt.rej
error: Bad exit status from /var/tmp/rpm-tmp.81391 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.81391 (%prep)

11. Looks like Patch 50 failed. Edit the spec file and comment out the line that begins with %patch50

%patch30 -p1 -b .dlopen
%patch31 -p1 -b .easter
%patch32 -p1 -b .systzdata
#%patch50 -p1 -b .tests-dashn
%patch51 -p1 -b .tests-wddx

12. For 5.2.9 as of this writing, this is the only patch that fails to load properly. In later versions, you may find that other patches fail to load, and you should comment those out as well.
13. Build the spec file again and after several minutes it will be complete and you'll have a handful of rpms in /usr/src/redhat/RPMS/i386

# rpmbuild -ba php.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.77534
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf php-5.2.9
+ /bin/gzip -dc /usr/src/redhat/SOURCES/php-5.2.9.tar.gz
+ tar -xf -
+ STATUS=0
... output snipped ...
Wrote: /usr/src/redhat/RPMS/i386/php-ncurses-5.2.9-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php-gd-5.2.9-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php-bcmath-5.2.9-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php-dba-5.2.9-1.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/php-debuginfo-5.2.9-1.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.7525
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd php-5.2.9
+ '[' /var/tmp/php-5.2.9-1-root-root '!=' / ']'
+ rm -rf /var/tmp/php-5.2.9-1-root-root
+ rm files.bcmath files.common files.dba files.dbase files.dom files.gd files.imap [snip]
+ exit 0


14. You'll probably want to also build the php-extras source RPM as well. php-extras provides extensions for dbase, readline, mcrypt, mhash, tidy and mssql. Since there is no package in CentOS Testing, grab the latest from 5.1.6.

# wget http://mirror.centos.org/centos/5/extras/SRPMS/php-extras-5.1.6-15.el5.centos.1.src.rpm

15. And install it.

# rpm -ivh php-extras-5.1.6-15.el5.centos.1.src.rpm

16. Copy the php-extras.spec file like you did for php.spec so you can have the original.

# cd /usr/src/redhat/SPECS
# cp php-extras.spec php-extras516.spec

17. We ultimately need to replace the patches in php-extras.spec with the same from the much newer php.spec, as well as the ABI version numbers in the beginning of the file. Webtatic.com has already done this and you can go ahead and download the edited spec file, which also includes new PHP 5.2 extensions for json and filter. Remember, if you had a failed patch from php.spec, you'll need to comment it out in php-extras.spec as well. For 5.2.9, I had to comment out patch50 again.

%patch32 -p1 -b .systzdata
#%patch50 -p1 -b .tests-dashn
%patch51 -p1 -b .tests-wddx
%build


18. Once your php-extras.spec file is up to date, build the spec file and see if you're missing any dependencies.

# rpmbuild -ba php-extras.spec
error: Failed build dependencies:
php-devel = 5.2.9 is needed by php-extras-5.2.9-1.i386
libmcrypt-devel is needed by php-extras-5.2.9-1.i386
mhash-devel is needed by php-extras-5.2.9-1.i386
libtidy-devel is needed by php-extras-5.2.9-1.i386
freetds-devel is needed by php-extras-5.2.9-1.i386

19. Let's go back and install the php package that we need. If you only want the minimum needed to build php-extras, start by installing php-devel and seeing what it asks for, and install it's dependencies.

# cd /usr/src/redhat/RPMS/i386
# rpm -ivh php-devel-5.2.9-1.i386.rpm
error: Failed dependencies:
php = 5.2.9-1 is needed by php-devel-5.2.9-1.i386
# rpm -ivh php-5.2.9-1.i386.rpm php-devel-5.2.9-1.i386.rpm
error: Failed dependencies:
php-cli = 5.2.9-1 is needed by php-5.2.9-1.i386
php-common = 5.2.9-1 is needed by php-5.2.9-1.i386
# rpm -ivh php-5.2.9-1.i386.rpm php-devel-5.2.9-1.i386.rpm php-cli-5.2.9-1.i386.rpm php-common-5.2.9-1.i386.rpm
Preparing... ########################################### [100%]
1:php-common ########################################### [ 25%]
2:php-cli ########################################### [ 50%]
3:php ########################################### [ 75%]
4:php-devel ########################################### [100%]

20. After installing those four packages, install the other packages with yum.

# yum install libmcrypt-devel mhash-devel libtidy-devel freetds-devel

21. Now that all of the dependencies are resolved, build the php-extras.spec file.

# cd /usr/src/redhat/SPECS
# rpmbuild -ba php-extras.spec

22. If you're using RHEL, the build might fail for two reasons: a library for tidy is needed, and mhash-devel isn't available for RHEL. Both are easy to fix. Install 'tidy' with yum, and while mhash-devel isn't available, you can download libmhash-devel and edit the spec file to require libmhash-devel instead of mhash-devel.

You should now have all of your RPMs in /usr/src/redhat/RPMS/i386 (or x86_64) and install whichever packages you want. If in doubt, install them all. They're mainly static libraries and won't bloat your system. You may not want to install the debuginfo packages since you may find little use for them.

Staying updated is easy, download the source from php.net into /usr/src/redhat/SOURCES and edit the spec files for the new version numbers, rebuild, and install RPMs. If you're concerned about new patches being needed, you can grab the latest source RPM from Centos: http://dev.centos.org/centos/5/testing/SRPMS/. If CentOS were to ever come out with a newer version, or you want to subscribe to a yum repo and they provided a higher version, it would update as normal. You would need to rebuild in pear/pecl libraries by uninstall+installing them.

Yes, this is an involved process the first time around, but after doing this once you only need to download the latest source from php.net and edit the spec file version number and rebuild and update. If an old patch fails in a newer version you'll need to comment it out, but it's that simple.

This also works for 64-bit installations. Thanks to DiNo for helping me get PHP built on a 64-bit RHEL installation.

If you'd like to skip the steps and get right to building, you can download and install the source RPMs and build again the spec files. If you'd like to do itself, you can compare my spec files to yours. Enjoy the latest PHP hotness!

Reference: http://echodittolabs.org/node/89