Install pear and use of some libraries

Source: Internet
Author: User
Tags pear

When you use PHP to develop a website, when you have many forms to process, when you need to use standard SQL statements, and when you need to automatically generate documents. In short, when you want to develop PHP-based websites and applications quickly and efficiently, the pear library will provide you with unexpected help. It is wise to use pear to develop PHP programs.

What libraries does pear provide? The pear library covers almost any aspects that can be operated using PHP, which are roughly as follows:

1. HTML form table paging template, which is very convenient;

2. GTK, gtk2, and PHP can also be used to write applications;

3. images is used to process images

4. Database Operations

5. MDB and mdb2, which are also used to operate databases and are new versions

6. xml and XML operations are as powerful as you cannot think.

7. The mail email library can help you save a lot of things

8. HTTP is used to process the network protocol.

9. Math, mathematical computation. If your program requires a large amount of precise mathematical computation, you can use it.

Let's take a rough look at this much. PEAR has thousands of libraries, which you can find in http://pear.php.net.

Well, let's talk about the installation of pear (many people think that the installation of pear is very difficult. In fact, this is a very easy task ).

Assume that you have installed php4.30 or later,

1. Double-click go-pear.bat in your PHP Directory

2. Just press Enter.
3. Some packages will be prompted to be bound to PhP. Select y and press Enter.

4. Okay. Your pear has been installed. It's too simple, isn't it?

5. open your PHP configuration file c: \ windows \ PHP. ini. then find; include_path = ".; d: \ PHP \ shortdes to include_path = ".; d: \ PHP \ des; D: \ PHP \ Pear"

6. Save PHP. ini, restart Apache, and OK. Everything is normal. Your pear is successfully installed!

Simple operations under the pear command line

You can find the pear. BAT file in your PHP root directory. This is the command for managing pear. Used in cmd, you need to set the environment variable path.

Run the following command in the DOS window (Change packegename to the package you want to use)

1. pearinstallpackagename. to install a new pear package, run the following command to install DB: D:/PHP/pearpearinstalldb:

1. Download but not install: peardownloadpackagename

Peardownload-all

2. All pear library lists available on the pear Website:

Pearremote-list

3. List Installed packages:

Pearlist

4. List packages that can be upgraded:

Pearlist-upgrades

5. Update (upgrade ):

Pearupgradepackagename

Pearupgrade-all

Remove the installed package:

Pearuninstallpackagename

The following describes the instances created using a simple form.

First install the html_quickform package

The method is as follows:

Pearinstallhtml_quickform

Bao has been installed. You can write code.

Require_once ("htmlquickform. php"); // call this package first

$ Form = newhtml_quickform ('frmtest', 'post'); // create an object

$ Form-> addelement ('header', header', 'logon page'); // set page information

$ Form-> addelement ('text', 'user _ name', 'user name: '); // set the user login input box

$ Form-> addelement ('Password', 'user _ password', 'password: '); // set the User Password

$ Form-> addelement ('submit ', 'submit', 'Submit'); // sets the submit button.

$ Form-> display (); // output the set information to the browser.

?>

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.