PHP Pear installation Configuration tutorial, pear installation Configuration Tutorial _php Tutorial

Source: Internet
Author: User
Tags deprecated pear

PHP Pear installation Configuration tutorial, pear installation Configuration tutorial


What is pear?

PEAR is an abbreviation for the PHP extension and application library (the PHP Extension and application Repository). It is a code repository for PHP extensions and applications, in short, pear to php like Cpan (Comprehensive perl Archive Network) to Perl.

This shows that pear is the repository of PHP code, here can find a lot of useful code, to avoid us to repeat some features, but the Pear code package is not directly downloaded through the HTTP website, we need to install pear.

How to obtain and install pear

Recommendation: The following operations in the Windows 7 environment, the same applies to the Windows xp/2003/vista/2008 system, some of the operation is tentative, in order to avoid detours, it is recommended to read this article before the relevant operation.

If the PHP directory does not have its own pear, Can not find the go-pear.php file, then we need to manually download the go-pear.php file, click here to download and save as go-pear.php, this file is placed in the Php.exe PHP installation directory, I install the directory is D:\ PHP5 (This is the directory below), then the go-pear.php location should be D:\php5\go-pear.php.

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

CD D:\PHP5
D:
PHP go-pear. php
Unfortunately, due to my PHP version is too new, the above operation prompts failed, the specific information is as follows:

Deprecated:assigning The return value of new by reference was 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 ver Sion.

Thank your coopertion and sorry for the inconvenience!

It means to ask us to download the Go-pear.phar file to Http://pear.php.net/go-pear.phar, and then replace go-pear.php to try again. 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 appears:

Is 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 pear settings for temporary, data, configuration, test, and execution directories:

Below is a suggested the file layout for your new PEAR installation. Tochange individual 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:

Direct enter use the default value and continue with the installation. I thought everything was going to be all right, but there was a mistake here:

Warning: date (): It is not safe for rely on the system ' s timezone settings. You is *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you used any of those methods and you is still getting this warning, your most likely misspelled the timezone Iden Tifier. 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 there is no permission to write to C:\Windows\pear.ini, because I am using a Windows 7 system, and then the normal user opened a command prompt, here of course no permission to write to the C:\Windows directory, it seems to be a further alternative. Back to just is you installing a system-wide PEAR or a local copy? This paragraph, why not choose local copy? Online are directly say the default return to select System, do not want to overwrite the C:\Windows directory, so I re-execute PHP go-pear.phar, and choose Local.

Is you installing a system-wide PEAR or a local copy?
(system|local) [System]: Local
Confirm local copy by typing ' yes ': Yes

Okay, this is normal,:-).

Would to alter PHP.ini ? [y/n]:
Then the above sentence, only select Y agree to modify the 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:
 
  

Then appear above this paragraph, there seems to be nothing good change, direct enter confirm can.

Here should be able to see thanks for using go-pear! This sentence, then congratulate you, Pear finally is installed successfully!

How to install the pear package

Next, let's go to the Pear website and see what we need. Pear Each package has a prompt to install commands, such as MDB2 this package, the above has been prompted to use the Pear Install MDB2 command installed, assuming the directory or D:\PHP5, then we use the following command to try:

CD D:\PHP5
D:
Pear Install MDB2
As a result, the following error occurred:

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

Unable to create the directory, it seems to be a privilege problem, simply start the cmd command prompt as an administrator, and then re-execute the above command. This is a successful installation. Install ok!

Another example of installation report: PHP Pear installation appears warning:require_once (structures/graph.php) ... Error

Install pear in Windows, all the way to the smooth installation completed, and then want to install the next pear email package to play, but then 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\pear\downloader.php on L
INE 1217
Novice no way to find solutions online. Toss the long time, or report the mistake. The reason is very clear is structures_graph this pear application, the direct General Pear command:
Pear Install structures_graph-1.1.1
Install this application online, but the sad thing is to report the same mistake, I lost.

Do not play with it directly to the Pear official website to download the STRUCTURES_GRAPH-1.1.0.TGZ package. Unzip and look inside the structure, found that there is just a structures/graph.php, then unzip and put the structures folder in the compressed package under the pear root. Then run the structures_graph installation command again, surprise!! It worked.

Then install email, no accident also success. To this this tangled up my half-day problem finally solved.

Thank you all for reading Oh!

http://www.bkjia.com/PHPjc/1127903.html www.bkjia.com true http://www.bkjia.com/PHPjc/1127903.html techarticle PHP Pear Installation configuration tutorial, pear installation configuration tutorial What is pear? PEAR is an abbreviation for the PHP extension and application library (the PHP Extension and application Repository). It is a php extension and should ...

  • 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.