PHP extension development: install PHP

Source: Internet
Author: User
For whatever reason, when I read this article, you need PHP extension development by default. This article will be divided into three series, from installation, simple implementation of an extension, to in-depth understanding of the extension mechanism and related APIs. This also plans to write down some of your PHP extension development experience and records over the past few years.

Preface
In several cases, PHP extension development is required:

  1. Resources or calls that PHP itself cannot access can be implemented through extension.
  2. It is better to use C for performance and efficiency considerations.
  3. In commercial or code protection considerations, encapsulate the code
  4. For a better understanding of PHP, get started here

    1. For whatever reason, when I read this article, you need PHP extension development by default. This article will be divided into three series, from installation, simple implementation of an extension, to in-depth understanding of the extension mechanism and related APIs. This also plans to write down some of your PHP extension development experience and records over the past few years.

      Preparations
      PHP extension development requires a PHP environment installed with source code. from a simple perspective, we recommend our company's open-source project MooENV.

      This is an open-source project for the automatic deployment of the LAMP environment. At present, it is mainly maintained by the company's O & M colleagues. It is especially suitable for VPS or virtual machine one-click installation environments. it is not recommended if it is too many. let's get started.


      Install Git
      To install Git under CentOS 5.x, you need to compile it by yourself. for details, refer to the article "install Git on CentOS"; directly under CentOS 6.x

         
         
      yum install git
      You can.


      Install MooENV
      First, clone the source code git of MooENV to the local machine to start the installation. follow the steps below to continue.

         
         
      Git clone git: // github.com/Ismole/MooENV.git
      Cd MooENV/
      Dmesg-c # The main purpose of this step is to clear system-level errors. if a system-level error occurs, MooENV cannot be installed any more. here, by default, you can install MooENV on a virtual machine, so ignore it directly.
      ./Install. sh

      The following describes how to install MooENV.

         
         
      Do You Agree To The Terms Of This License? (Y/N)
      # Y is required.
      === Which Integrate Environment You Want? ===
      1: L. N. M.P-Nginx/PHP-FastCGI/MySQL/NoSQL
      2: L.A. M.P-Apache/PHP/MySQL/NoSQL
      # Select Apache or Nginx based on your preferences
      Do you want to change default YUM mirror to others? (Y/n)
      # I select y for the new system and upgrade YUM for the new system.
      SELECT YUM MIRROR
      1. 163-http://mirrors.163.com
      2. Sohu-http://mirrors.sohu.com
      3. Custom-Manually input URL
      Which YUM Mirror Do You Want To Use? (1/2/3 ):
      # I usually select 163 YUM image
      Do you want to perform a YUM update now? (Y/n)
      # Whether to upgrade YUM immediately. we recommend that you upgrade YUM.
      # The installation process of the dependent database
      === Set MySQL root password ===
      * ** Input password:
      # Enter the MySQL root password
      === Environment Backup Setting ===
      Do you want to add backup job to system cron? (Y/N)
      # Add automatic backup?
      === System Services Configuration ===
      Do you want Web Server start at boot time? (Y/N)
      # Whether to automatically start Nginx or Apache
      Do you want MySQL Server start at boot time? (Y/N)
      # Whether to automatically start MySQL

      PHP installation complete
      In the future, the most commonly used directory will be the PHP source code directory, which may be

         
         
      cd MooENV/src/php-5.3.8/ext/

      After the content of this article is complete, you may see the following picture. the focus of this article is to recommend MooENV, haha.


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.