Upgrade to Pro — share decks privately, control downloads, hide ads and more …

8時間耐久 PHP構築の教室

8時間耐久 PHP構築の教室

ビルドの方法を学んでソースからPHPを構築します。さまざまな設定や拡張を試して見ながら最終的にはnginxとphp-fpmでWordPressを動かしてみましょう。

Yusuke Ando

July 10, 2012
Tweet

More Decks by Yusuke Ando

Other Decks in Programming

Transcript

  1. ࣌ؒ଱ٱ1)1ߏஙͷڭࣨ:VTVLF"OEP !ZBOEP ࣗಈΠϯετʔϧ # yum install php # apt-get install

    php # port install php5 Կ͕ى͖͔ͨཧղ͍ͯ͠Δʁ ༁΋෼͔Βͣίϐϖͯ͠ͳ͍ʁ τϥϒϧͷݪҼ͕Θ͔Δʁ ઃఆͷํ๏͸ʁ
  2. ࣌ؒ଱ٱ1)1ߏஙͷڭࣨ:VTVLF"OEP !ZBOEP 1)1ͷιʔε $ find ./ -type f | grep

    "\.c" | wc 905 905 27290 wେྔͷ$ͷιʔε܈ wେ·͔ͳϨΠΞ΢τΛ஌͓ͬͯ͘ͱτ ϥϒϧղܾʹ໾ཱͭ
  3. ࣌ؒ଱ٱ1)1ߏஙͷڭࣨ:VTVLF"OEP !ZBOEP ಈ࡞֬ೝ ͳΜ͔ಈ͖ͦ͏ʁ $ ./sapi/cli/php -v PHP 5.4.4 (cli)

    (built: Jul 8 2012 04:15:27) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies $ ./sapi/cli/php -r 'echo "Hello Wolrd\n";' Hello Wolrd
  4. ࣌ؒ଱ٱ1)1ߏஙͷڭࣨ:VTVLF"OEP !ZBOEP ಈ͔͚ͩ͢ͳΒ $ php -S 192.168.225.15:8000 PHP 5.4.4 Development

    Server started at Sun Jul 8 04:50:57 2012 Listening on 192.168.225.15:8000 Document root is /home/yando/docs Press Ctrl-C to quit. [Sun Jul 8 04:51:00 2012] 192.168.225.5:57229 [200]: /index.php 1)1͔Βͷ৽ػೳ 1)1͚ͩͰ։ൃαʔόʹͳΔ
  5. ࣌ؒ଱ٱ1)1ߏஙͷڭࣨ:VTVLF"OEP !ZBOEP FUDOHJOYDPOGEEFGBVMUDPOG location ~ \.php$ { root html; fastcgi_pass

    127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } # cp -f /usr/local/etc/php-fpm.conf.default /usr/local/ etc/php-fpm.conf # cp -f sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm # chmod 755 /etc/init.d/php-fpm # mkdir /var/log/php-fpm # chown -R nginx:nginx /var/log/php-fpm