2012年5月30日星期三

LinuxでソースからCakePHPの開発環境構築


ソフトウェア リスト

【Webサーバ】
    ・httpd-2.2.22.tar.gz
  【開発言語】
    ・php-5.4.3.tar.gz
    ・cakephp-cakephp-2.1.1-0-g43cf2f0.zip
  【DBサーバ】
    ・mysql-5.5.24.tar.gz
  【バージョン管理サーバ】
    ・subversion-1.7.5.tar.gz
  

Apacheのインストール

  System Requirements

libtool
    autoconf
    Disk Space
    ANSI-C Compiler and Build System(The GNU C compiler (GCC)is recommended)
    Accurate time keeping
    Perl 5 [OPTIONAL]
    apr/apr-util >= 1.2
  

  Obtain the Apache HTTP server


  Build and install Apache

    gzip -d httpd-2_x_NN.tar.gz
    tar -xf httpd-2_x_NN.tar
    cd httpd-2_x_NN
    ./configure --enable-so
    make
    make install
  

  Setup httpd.conf


  Confirming or testing installation

    /usr/local/apache2/bin/httpd -t
    /usr/local/apache2/bin/apachectl start
    /usr/local/apache2/bin/apachectl stop
  


Installing MySQL from a Standard Source Distribution

Source Installation System Requirements

    CMake                ※http://www.cmake.org. 
    make※GNU make 3.75 or newer is recommended 
    ANSI C++ compiler    ※GCC 4.2.1 or later is recommended
    Perl                 ※is needed if you intend to run test scripts
    GNU gunzip
    GNU tar※is available from  
  

Preconfiguration setup

    shell> groupadd mysql
    shell> useradd -r -g mysql mysql

Beginning of source-build specific instructions

    shell> tar zxvf mysql-VERSION.tar.gz
    shell> cd mysql-VERSION
    shell> cmake .
    shell> make
    shell> make install
  

Beginning of source-build specific instructions

    shell> tar zxvf mysql-VERSION.tar.gz
    shell> cd mysql-VERSION
    shell> cmake .
    shell> make
    shell> make install
  

Postinstallation setup

    
    shell> cd /usr/local/mysql
    shell> chown -R mysql .
    shell> chgrp -R mysql .
    shell> scripts/mysql_install_db --user=mysql
    shell> chown -R root .
    shell> chown -R mysql data
  

Next command is optional

    
    shell> cp support-files/my-medium.cnf /etc/my.cnf
    shell> bin/mysqld_safe --user=mysql &
    shell> cp support-files/mysql.server /etc/init.d/mysql.server
  

Postinstallation Setup and Testing


PHPのインストール

  General Installation Considerations


    For what

    1.Websites and web applications (server-side scripting)  ○
    2.Command line scripting
    3.Desktop (GUI) applications
  

    Web server to use

    1.web server
      1-1.Apache    ○
      1-2.IIS
    2.web browser
  

    How to connect PHP to the server

    1.SAPI      ○
    2.ISAPI
    3.CGI、FastCGI    ※If PHP has no module support for your web server
  

  Configuration and Installation of PHP on Unix systems


    Prerequisite knowledge and software for compiling

    ・Basic Unix skills (being able to operate "make" and a C compiler) 
    ・An ANSI C compiler
    ・A web server
    ・Any module specific components (such as GD, PDF libs, etc.) 
  

    When building directly from SVN sources or after custom modifications you might also need

    ・autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0)
    ・automake: 1.4+
    ・libtool: 1.4.x+ (except 1.4.2)
    ・re2c: Version 0.13.4 or newer
    ・flex: Version 2.5.4 (for PHP <= 5.2)
    ・bison: Version 1.28 (preferred), 1.35, or 1.75
  

  Obtain the PHP source file


  Configure、Build and Install PHP

    gunzip php-NN.tar.gz
    tar -xf php-NN.tar
    cd ../php-NN
    ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
    make 
    make install ※will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more.
  

  Setup your php.ini

  
  cp php.ini-development /usr/local/lib/php.ini
  

  Edit your httpd.conf

    LoadModule php5_module modules/libphp5.so ※The make install from above may have already added this for you, but be sure to check. 
    <filesmatch .php$="">
      SetHandler application/x-httpd-php
    </filesmatch>
  


  Confirming or testing installation

    /usr/local/apache2/bin/httpd -t
    /usr/local/apache2/bin/apachectl start
    /usr/local/apache2/bin/apachectl stop
  

没有评论:

发表评论