Simple learning experience of Apache + PHP + pear installation and configuration + memcache

Source: Internet
Author: User
Tags value store

What is memcache?
Memcache is a danga.com project that was first used for livejournal. Many people around the world use this cache project to build their own websites with high load.

The pressure on the database.
It can cope with any number of connections and use non-blocking network I/O. Because its working mechanism is to open up a space in the memory, and then create a hashtable, me

Mcached self-manages these hashtable.
Official website of memcache: http://memcached.org/. for more details, refer 

 

Why are there two memcache and memcached names?
In fact, memcache is the name of this project, and memcached is the master of its server.ProgramThe file name ~~~~.

One is the project name, the other is the main program file name, and many people on the Internet do not understand it, so it is mixed.

 

Official Original:

What is memcached?

Free & open source, high-performance, distributed memory Object Caching System, Generic in nature, but intend

Ed for use in speeding up dynamic Web applications by alleviating database load.

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of Database

Call, API call, or page rendering.

Memcached is simple yet powerful. Its simple design promotes quick deployment, development of development, and solves man

Y problems facing large data caches. ItsAPIIs available for most popular ages.

Install memcache
There are two steps: Install the memcache server and the memcached client.
The so-called server-side installation is to install memcache on the server (generally Linux systems) to store data.

:Http://pecl.php.net/package/memcache
The so-called Client installation refers to PhP (or other programs, memcache and other good API interfaces) to use the functions provided by memcache on the server.

Add extensions in PHP.

 :Http://code.google.com/p/memcached/downloads/list

 

 

First, install Apache.

: Http://httpd.apache.org/download.cgi

Download a for Windows instance, such

  • Win32 binary without crypto (no mod_ssl) (MSI installer): httpd-2.2.15-win32-x86-no_ssl.msi [PGP] [MD5] [sha1]
  • Win32 binary including OpenSSL 0.9.8m (MSI installer): httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi [PGP] [MD5] [sha1]
  • NOTE: If OpenSSL is installed, you do not need to install it again. Otherwise, install the following version;

    Apache installation is silly .. (Note: If your system is installed with IIS or other Web servers, stop working first ),

    After the installation is complete, access http: // localhost and a message indicating that the server is working: It works!

    Install PHP

    : Http://windows.php.net/download

    downloaded by myself: http://windows.php.net/downloads/releases/php-5.3.2-Win32-VC6-x86.zip

    It is best not to use the installation package, because it does not include the extended part, and you may use this part in your project, configure php as follows:

    A. decompress the package to the E: \ php-5.3.2-Win32-VC6-x86 \ folder (select another disk)

    B. Copy PHP. ini-recommended from E: \ php-5.3.2-Win32-VC6-x86 \ to the Windows folder and rename it PHP. ini

    C. Open PHP. ini and change php_gd2.dll, php_mysql.dll, php_mysqli.dll, and php_xsl.dll to extension (simply remove the semicolons in front of them)

    D. It is recommended to send an error report in the development environment (this step is optional), locate error_reporting in PHP. ini, and change it to error_reporting = e_all.

    E. Under E: \ php-5.3.2-Win32-VC6-x86 \ php5ts. dll, libmysql. dll (If php does not have this stuff, directly from the MySQL installation directory,

    E: \ mysql-5.1.39-win32 \ Lib \ debug Direct Copy) Copy To the System32 folder of Windows

    F. Copy php_gd2.dll, php_mysql.dll, php_mysqli.dll, php_xsl.dll under E: \ php-5.3.2-Win32-VC6-x86 \ ext \ To the System32 folder of windows.

    G. Open the Apache configuration file httpd. conf, find many loadmodule entries, and add the following content:

     Loadmodule php5_module E:/php-5.3.2-Win32-VC6-x86/php5apache2_2.dll

    Locate <ifmodule mime_module> and add the following content in the corresponding location: Addtype application/X-httpd-PHP. php H. Find the directoryindex entry and change it to the following:

    Directoryindex index.html. var index. php

    I. Save the file and restart the Apache server.
    J. In the E: \ Program Files \ Apache Software Foundation \ apache2.2 \ htdocs directory (this is the default website path. You can modify the configuration and search for this part,

    Change it to the actual path,

     

    Note: \ replace all with/) to delete the original file and create a new file named index. php. The content is as follows:
    <? PHP
    Phpinfo ();
    ?> 
    K. Finally, enter the URL in the browserHttp: // localhost/index. php, You will see the page of related PHP Information

    L. Success!

    Install Pear

    Pear isPHPThe extension and application Library contain many useful classes. After php5.0 is installed, pear is not actually installed;

    The installation is as follows:

    Select http://pear.php.net/manual/en/installation.getting.php from http://pear.php.net/go-pear.Code

    And save the file named go-pear.php, put it in any folder, such as E: \ php-5.3.2-Win32-VC6-x86 \ go-pear.php (best place under the installation directory of PHP)

    Then open the command console, go to the go-pear.php directory,

    Enter the command: PhP go-pear.php

    Start installation. Select the default one according to different situations.

    Restart Apache;

    **************************************** **************************************** ********************

    Modify my. ini

      Modifying PHP. ini To get pear working properly, you need to adjust PHP's ready de_path. After you found PHP. ini, open it in an editor.

    Search for the lineInclude_path.

    Now that you found it, you probably will see a semicolon;At the beginning. This means the line is a comment.

    Add a new line below it.

    In this line, write:

     
    Include_path = "."

    Depending on your operating system, add:(Unix/Linux/FreeBSD/Mac OS X) or;(Windows) after the dot.

    Add pear'sPhp_dirAfter it.

    (The DirectorySystem. phpIs located in !)

    The result shoshould look like that:

     
    ; Unixinclude_path = ".:/usr/local/PHP/pear /"

    Or

     
    ; Windowsinclude_path = ".; E: \ php-5.3.2-Win32-VC6-x86 \ pear \"

    You should understand the English above (simple, do not want to translate)

    * ********** I feel that this is an optional setting, because there is a prompt for modification during installation, but later I found that it was not modified, but it can be used .. **********

    For more information, see http://pear.php.net/manual/en/installation.getting.php and

    Http://pear.php.net/manual/en/installation.checking.php#installation.checking.cli.modifyingphpini

    Plus +

    Http://pear.php.net/package/PEAR/download/All

    After the configuration is complete, record it here .....

    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.