PHPpear installation and configuration tutorial, pear installation and configuration tutorial _ PHP Tutorial

Source: Internet
Author: User
PHPpear installation and configuration tutorial, pear installation and configuration tutorial. PHPpear installation and configuration tutorial. pear installation and configuration tutorial. what is PEAR? PEAR is the abbreviation of PHP extension and application library (thePHPExtensionandApplicationRepository. It is a PHP extension and PHP pear installation and configuration tutorial, pear installation and configuration tutorial

What is PEAR?

PEARIs the abbreviation of the PHP Extension and Application Repository. It is a code repository for PHP extensions and applications. In short, PEAR is like CPAN (Comprehensive Perl Archive Network) to Perl in PHP.

It can be seen that PEAR is the repository of PHP code. here we can find a lot of useful code to avoid repeated writing of some features. However, the PEAR code package is not downloaded directly through the HTTP website, we need to install PEAR.

How to obtain and install PEAR

Suggestion: The following operations are completed in Windows 7, which is also applicable to Windows XP, 2003, Vista, and 2008 systems. some operations are tentative. to avoid detours, we recommend that you read this article first, then perform related operations.

Under the PHP installation directory where idea is located, my installation directory here is D: \ php5 (the following directory prevails), then the location of the go-pear.php should be D: \ php5 \ go-pear.php.

Start-run, enter cmd, start command prompt, enter the following command, mainly to switch to the go-pear.php directory, and then execute this PHP script file:

Cd D: \ php5
D:
Php go-pear.php
Unfortunately, because my PHP version is too new, the above operation prompts a failure. The details are as follows:

Deprecated: Assigning the return value of new by reference is deprecated in D: \ php5 \ go-pear.php on line 733.

Sorry! Your PHP version is too new (5.3.8) for this go-pear.

Instead use http://pear.php.net/go-pear.phar for a more stable and current version of go-pear, more suited to your PHP version.

Thank you for your coopertion and sorry for the inconvenience!

This means we need to download the go-pear.pharfile from http://pear.php.net/go-pear.phar, and try again later on behalf of go-pear.php. Download the go-pear.phar file and put it in the D: \ php5 folder, and execute the following command:

Cd D: \ php5
D:
Php go-pear.phar
This occurs:

Are you installing a system-wide PEAR or a local copy?
(System | local) [system]:
Press enter to default system and continue. The following are the default settings for the temporary, data, configuration, test, and execution directory of pear:

Below is a suggested file layout for your new PEAR installation. Tochange inpidual locations, type the number in front of thedirectory. Type 'all' to change all of them or simply press Enter toaccept these locations.  1. Installation base ($prefix)     : D:\php5 2. Temporary directory for processing   : D:\php5\tmp 3. Temporary directory for downloads    : D:\php5\tmp 4. Binaries directory       : D:\php5 5. PHP code directory ($php_dir)     : D:\php5\pear 6. Documentation directory      : D:\php5\docs 7. Data directory        : D:\php5\data 8. User-modifiable configuration files directory : D:\php5\cfg 9. Public Web Files directory     : D:\php5\www10. Tests directory        : D:\php5\tests11. Name of configuration file     : C:\Windows\pear.ini12. Path to CLI php.exe       : D:\php5 1-12, 'all' or Enter to continue:

Press enter to use the default value and then continue the installation. I thought everything was great, but it was hereError:

Warning:Date (): It is not safe to rely on the system's timezone settings. you are * required * to use the date. timezone setting or the date_default_timezone_set () function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we selected 'utc' for '8. 0/no DST 'Instead in phar: // D: // php5/go-pear.phar/PEAR/Registry. php on line 1012
PEAR_Config: writeConfigFile fopen ('C: \ Windows \ pear. ini ', 'w') failed (fopen (C: \ Windows \ pear. ini): failed to open stream: Permission denied)

It seems that you have no permission to write data to C: \ Windows \ pear. ini, because I am using a Windows 7 system, and then a command prompt opened by a common user, I certainly do not have the permission to write to the C: \ Windows directory here. it seems that I am going to find another way. Back to Are you installing a system-wide PEAR or a local copy? In this section, why not select local copy? The Internet is directly said the default press enter to select system, do not want to rewrite the C: \ Windows directory, so I re-execute the php go-pear.phar, and select local.

Are you installing a system-wide PEAR or a local copy?
(System | local) [system]: local
Please confirm local copy by typing 'yes': yes

Okay, this is normal :-)

Wocould you like to alter php. ini ? [Y/n]:
Then, just select Y to agree to modify php. ini.

php.ini 
 
   include_path updated. Current include path   : .;C:\php\pearConfigured directory   : D:\php5\pearCurrently used php.ini (guess) : D:\php5\php.iniPress Enter to continue:
 

The above section appears, it seems that there is nothing to change, just press enter to confirm.

Here we can see Thanks for using go-pear! Congratulations! the installation of PEAR is successful!

How to install the PEAR Package

Next, let's go to the PEAR website to see what we need. Each PEAR package has a command installation prompt. for example, if the MDB2 package is installed, the above prompt is to use the pear install MDB2 command. assume that the directory is still D: \ php5, use the following command to try:

Cd D: \ php5
D:
Pear install MDB2
The following error occurs:

D:\php5>pear install MDB2downloading MDB2-2.4.1.tgz ...Starting to download MDB2-2.4.1.tgz (119,790 bytes)..........................done: 119,790 bytesERROR: failed to mkdir C:\php\pear\docs\MDB2\docs\examples

The directory cannot be created, which seems to be a permission issue. simply start the cmd command prompt as an administrator and then re-execute the preceding command. The installation was successful this time. install OK!

Another installation error case:The following error occurs when installing PHP pear: require_once (Structures/Graph. php )...

The installation of pear in WINDOWS is smooth and smooth, and you want to install the pear email package. However, the following is reported:

Warning: require_once (Structures/Graph. php): failed to open stream: No such file
Or directory in PEAR \ Downloader. php on line 1217
PHP Warning: require_once (Structures/Graph. php): failed to open stream: No such
File or directory in E: \ Program Files \ php5_3 \ pear \ PEAR \ Downloader. php on l
Ine 1217
New users cannot find a solution online. This error was reported after a long time. it is clear that the PEAR application Structures_Graph is missing and the pear command is used directly:
Pear install Structures_Graph-1.1.1
I am sorry for the same error when installing this application online ..

Do not play with it directly to the PEAR official website to download the Structures_Graph-1.1.0.tgz package. Decompress the file and check the structure. The file contains Structures/Graph. php. decompress the file and put the Structures folder in the compressed file under the pear root. Run the Structures_Graph installation command again !! Succeeded.

Then install the email, and it will succeed without any accident. At this point, I had to solve this problem for a long time.

Thank you for reading this article!

Http://www.bkjia.com/PHPjc/1127903.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1127903.htmlTechArticlePHP pear installation configuration tutorial, pear installation configuration tutorial what is PEAR? PEAR is the abbreviation of the PHP Extension and Application Repository. It is a PHP extension and application...

Related Article

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.