Home Backend Development PHP Tutorial How to install and use PEAR_PHP yourself Tutorial

How to install and use PEAR_PHP yourself Tutorial

Jul 13, 2016 pm 05:12 PM
pear php use close Function and how Install powerful Own Standardize

As a standardized and powerful arsenal in PHP, PEAR has always attracted much attention, but it has not been taken seriously in the practical field. The reasons include incomplete documentation, insufficient learning materials, a complicated code system, and insufficient developer support.
But sooner or later this arsenal will be given enough attention. If you can start learning now, you may be able to gain a certain advantage.
There is a support issue with PEAR usage. Many servers may use disable pear when compiling, so PEAR is not supported. Because its installation requires permission to modify php.ini, users may feel powerless for unsupported hosts.
There is another situation where the host server provides PEAR, and you can see the PEAR inclusion in phpinfo. However, since the host is running in safe mode, since the owner of PEAR is not you, you still not available.
Here is a method that you can install PEAR yourself on your shared hosting.
According to the requirements of the PEAR document, your PHP can be used with version 4.04 or above, but some modules require version 4.05 or above, which actually means that the minimum requirement is still version 4.05. Of course, this is not a problem, because if your host is still on 4.06, you should consider changing the host.
Things to consider when choosing poems for PEAR’s own version. You may notice that PEAR is included in all PHP source packages, but in fact PEAR in the latest PRE version is not complete at all. So my suggestion is to download the 4.23 release package, unzip it and upload all the contents of the pear directory to your home directory, and keep the directory name as pear.
If you are patient enough, you can download the latest version 4.30pre2, and then use the diff tool to compare (I mean Windows users), and directly replace the old files with the new changed files.
If you take the trouble, you can go to the pear directory in http://cvs.php.net to download the latest version of each file.
Use PEAR:
Add
ini_set("include_path", "/absolute/path/to/pear");
in the head of your program;
In this way, you will directly change include_path to your pear Table of contents.
One disadvantage of the above settings is that if you have other include directories, they will be cancelled. So you need to consider other existing include paths.
In the user comments in the PHP manual, someone suggested using:
ini_set("include_path",ini_get("include_path").": /path/to/pear");
This way.
I'm not sure this might work for you.
But at least my server doesn’t support it, so there will be problems.
For me I can only use:
$oldpath = ini_get("include_path");
ini_set("include_path","/path/to/pear:".$oldpath);
Look carefully The difference between the two is whether the pear path is placed at the beginning or at the end. (The colon is the path delimiter).
I think you may need to test both cases to see which one works.

http://www.bkjia.com/PHPjc/629466.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629466.htmlTechArticlePEAR, as a standardized and powerful arsenal in PHP, has always attracted much attention, but it has not been widely used in practical fields. Pay attention to. The reason is that the documentation is incomplete and the learning materials are insufficient...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles