bashtag

宮崎でITベンチャーから非ITベンチャーへ転職したサーバエンジニアのブログ

ソースコンパイルでサーバ構築 CentOS版 Part6

このシリーズは今日でラストです

  • OS:CentOS6.4
  • Web:Nginx + php-fpm + PHP
  • DB:MySQL

Symfonyをインストールします

# Composerでインストールするとパッケージ管理ができて便利
curl -s https://getcomposer.org/installer | php

#----- 出力 START
#!/usr/bin/env php
All settings correct for using Composer
Downloading...

Composer successfully installed to: /var/www/html/composer.phar
Use it: php composer.phar
#----- 出力 E N D


# ComposerでSymfonyをインストール
# 最後のバージョンの部分を最新安定版の数字に置き換えてください
php composer.phar create-project symfony/framework-standard-edition /var/www/html/Symfony 2.4.2

#----- 出力 START
Installing symfony/framework-standard-edition (v2.4.2)
  - Installing symfony/framework-standard-edition (v2.4.2)
    Downloading: 100%

Created project in /var/www/html/Symfony
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing jdorn/sql-formatter (v1.2.17)
    Downloading: 100%

  - Installing psr/log (1.0.0)
    Downloading: 100%

  - Installing twig/twig (v1.15.1)
    Downloading: 100%

  - Installing doctrine/lexer (v1.0)
    Downloading: 100%

  - Installing doctrine/annotations (v1.1.2)
    Downloading: 100%

  - Installing doctrine/collections (v1.2)
    Downloading: 100%

  - Installing doctrine/cache (v1.3.0)
    Downloading: 100%

  - Installing doctrine/inflector (v1.0)
    Downloading: 100%

  - Installing doctrine/common (v2.4.1)
    Downloading: 100%

  - Installing symfony/symfony (v2.4.2)
    Downloading: 100%

  - Installing symfony/icu (v1.1.0)
    Downloading: 100%

  - Installing doctrine/dbal (v2.4.2)
    Downloading: 100%

  - Installing doctrine/doctrine-bundle (v1.2.0)
    Downloading: 100%

  - Installing kriswallsmith/assetic (v1.1.2)
    Downloading: 100%

  - Installing symfony/assetic-bundle (v2.3.0)
    Downloading: 100%

  - Installing sensio/framework-extra-bundle (v3.0.0)
    Downloading: 100%

  - Installing doctrine/orm (v2.4.2)
    Downloading: 100%

  - Installing twig/extensions (v1.0.1)
    Downloading: 100%

  - Installing swiftmailer/swiftmailer (v5.0.3)
    Downloading: 100%

  - Installing symfony/swiftmailer-bundle (v2.3.5)
    Downloading: 100%

  - Installing monolog/monolog (1.7.0)
    Downloading: 100%

  - Installing symfony/monolog-bundle (v2.5.1)
    Downloading: 100%

  - Installing sensio/distribution-bundle (v2.3.4)
    Downloading: 100%

  - Installing sensio/generator-bundle (v2.3.4)
    Downloading: 100%

  - Installing incenteev/composer-parameter-handler (v2.1.0)
    Downloading: 100%

kriswallsmith/assetic suggests installing leafo/lessphp (Assetic provides the integration with the lessphp LESS compiler)
kriswallsmith/assetic suggests installing leafo/scssphp (Assetic provides the integration with the scssphp SCSS compiler)
kriswallsmith/assetic suggests installing ptachoire/cssembed (Assetic provides the integration with phpcssembed to embed data uris)
kriswallsmith/assetic suggests installing leafo/scssphp-compass (Assetic provides the integration with the SCSS compass plugin)
monolog/monolog suggests installing mlehner/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
Writing lock file
Generating autoload files
Creating the "app/config/parameters.yml" file
Some parameters are missing. Please provide them.
database_driver (pdo_mysql):
database_host (127.0.0.1):
database_port (null):
database_name (symfony):
database_user (root): symfony
database_password (null): symfony
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
locale (en): ja
secret (ThisTokenIsNotSoSecretChangeIt): xdmBxaLYjytQVbk4
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution

#----- 出力 E N D


# チェック
php app/check.php
#----- 出力 START
*********************************                              *
*  Symfony requirements check  *
*                              *
********************************

* Configuration file used by PHP: /etc/php.ini

** ATTENTION **
*  The PHP CLI can use a different php.ini file
*  than the one used with your web server.
*  To be on the safe side, please also launch the requirements check
*  from your web server using the web/config.php script.

** Mandatory requirements **

 OK       PHP version must be at least 5.3.3 (5.5.9 installed)
 OK       PHP version must not be 5.3.16 as Symfony wont work properly with it
 OK       Vendor libraries must be installed
 OK       app/cache/ directory must be writable
 OK       app/logs/ directory must be writable
 OK       date.timezone setting must be set
 OK       Configured default timezone "Asia/Tokyo" must be supported by your installation of PHP
 OK       json_encode() must be available
 OK       session_start() must be available
 OK       ctype_alpha() must be available
 OK       token_get_all() must be available
 OK       simplexml_import_dom() must be available
 OK       detect_unicode must be disabled in php.ini
 OK       PCRE extension must be available

** Optional recommendations **

 OK       Requirements file should be up-to-date
 OK       You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions
 OK       When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156
 OK       You should not use PHP 5.4.0 due to the PHP bug #61453
 OK       When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)
 OK       You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909
 OK       PCRE extension should be at least version 8.0 (8.32 installed)
 OK       PHP-XML module should be installed
 OK       mb_strlen() should be available
 OK       iconv() should be available
 OK       utf8_decode() should be available
 WARNING  posix_isatty() should be available
          Install and enable the php_posix extension (used to colorize the CLI output).

 OK       intl extension should be available
 OK       intl extension should be correctly configured
 OK       intl ICU version should be at least 4+
 WARNING  a PHP accelerator should be installed
          Install and enable a PHP accelerator like APC (highly recommended).

 OK       short_open_tag should be disabled in php.ini
 OK       magic_quotes_gpc should be disabled in php.ini
 OK       register_globals should be disabled in php.ini
 OK       session.auto_start should be disabled in php.ini
 OK       PDO should be installed
 OK       PDO should have some drivers installed (currently available: mysql, sqlite)

#----- 出力 E N D


# cacheとlogsのディレクトリに書き込み権限を付与
chmod 777 app/cache
chmod 777 app/logs

# IPを許可して
Symfony/web/config.php

# アクセス

ソースコンパイルによるサーバ構築の備忘録はここまで。