centos:centos_nginx_php
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
centos:centos_nginx_php [2014/11/05 02:05] – clownclown | centos:centos_nginx_php [2025/02/16 13:53] (現在) – 外部編集 127.0.0.1 | ||
---|---|---|---|
行 14: | 行 14: | ||
{{page> | {{page> | ||
- | ===== PHP 5.3 ===== | + | ===== PHPと関連モジュール |
< | < | ||
- | ● remiリポジトリを登録 | + | # yum -y --enablerepo=remi install php php-mbstring php-mysql php-pear php-devel |
- | # rpm -Uvh http:// | + | # vi / |
- | + | 869c869 | |
- | ● PHP インストール | + | < date.timezone = "Asia/Tokyo" |
- | # yum -y --enablerepo=remi install php | + | --- |
- | + | > ; | |
- | + | 1350c1350 | |
- | </code> | + | < session.save_path = "/var/ |
- | ===== PDO ===== | + | --- |
- | < | + | > ; |
- | # yum -y --enablerepo=remi install php-pdo | + | # ll / |
- | + | 合計 4 | |
- | + | drwxrwx---. 2 root apache 4096 10月 16 17:24 2014 session | |
- | </code> | + | # chown -R root.nginx / |
- | ===== pear ===== | + | # ll / |
- | <code> | + | 合計 4 |
- | # yum -y --enablerepo=remi install php-pear | + | drwxrwx---. 2 root nginx 4096 10月 16 17:24 2014 session |
- | + | ||
- | + | ||
</ | </ | ||
+ | |||
===== APC(PHP用アクセラレータ) ===== | ===== APC(PHP用アクセラレータ) ===== | ||
< | < | ||
- | # yum -y --enablerepo=remi install | + | # yum -y --enablerepo=remi install |
- | # yum -y --enablerepo=remi install httpd-devel | + | # pecl install apc |
- | # pecl install apc | + | # echo " |
- | # echo " | + | |
- | + | ||
- | + | ||
- | </ | + | |
- | ===== FastCGI ===== | + | |
- | < | + | |
- | ●参考サイト | + | |
- | http:// | + | |
- | + | ||
- | http:// | + | |
- | > fpm(FastCGI Process Manager)はphpでFastCGIを使うための実装の一つです。 | + | |
- | > php 5.3.3でfpmが標準で使えるようになったので使ってみる。今まではphpに | + | |
- | > パッチを当てる必要がありました。ただし、標準になったとはいえ、PHPのコ | + | |
- | > ンパイル時にオプションの設定が必要なので、configureからやり直す必要が | + | |
- | > ある。尚、fpmのコンパイルするにあたって予め1.4系のlibeventをインストール | + | |
- | > しておく必要があります。 | + | |
- | + | ||
- | ⇒ 5.3.4 では全く作業しなくても動いている。。。 | + | |
- | + | ||
</ | </ | ||
+ | |||
===== PHP-FPM ===== | ===== PHP-FPM ===== | ||
< | < | ||
- | ●参考サイト | + | # yum -y --enablerepo=remi install php-fpm |
- | http://php.net/ | + | # vi /etc/php-fpm.d/www.conf |
- | + | 39c39 | |
- | ● PHP-FPM インストール | + | < user = nginx |
- | # yum -y --enablerepo=remi install php-fpm | + | --- |
- | + | > user = apache | |
- | ● nginx への設定追加 | + | 41c41 |
- | # vi /etc/nginx/nginx.conf | + | < group = nginx |
- | + | --- | |
- | 108行目付近、以下の行を追加。 | + | > group = apache |
- | 101行目付近にコメントされている行があるので、「\.php」の「\」をはずし、 | + | |
- | SCRIPT_FILENAE のパスを修正。 | + | nginx への設定追加 |
- | + | # vi /etc/nginx/conf.d/ | |
- | location ~ .php$ { | + | |
- | | + | 9,10c9,10 |
- | | + | < |
- | | + | < |
- | | + | --- |
- | | + | > |
- | } | + | > |
- | + | 30, | |
- | ● PHP-FPM 起動 | + | < location ~ \.php$ { |
- | # /etc/rc.d/init.d/php-fpm start | + | < root /var/www/html; |
- | + | < fastcgi_pass | |
- | ● nginx 再起動(設定反映) | + | < fastcgi_index |
- | # /etc/init.d/nginx restart | + | < fastcgi_param |
- | + | < include | |
- | ● 自動起動設定 | + | < } |
- | # chkconfig | + | --- |
- | + | > #location ~ \.php$ { | |
- | ● ブラウザからphpファイルにアクセスして表示されることを確認 | + | > # |
- | + | > # | |
+ | > # | ||
+ | > # | ||
+ | > # | ||
+ | > #} | ||
+ | PHP-FPM 起動 | ||
+ | # / | ||
+ | 自動起動設定 | ||
+ | # chkconfig php-fpm on | ||
+ | |||
+ | nginx 再起動(設定反映) | ||
+ | # / | ||
</ | </ | ||
+ | |||
===== TokyoCabinet/ | ===== TokyoCabinet/ | ||
< | < |
centos/centos_nginx_php.1415153104.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)