ユーザ用ツール

サイト用ツール


centos:centos_nginx_php

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
centos:centos_nginx_php [2014/11/05 02:05] clownclowncentos:centos_nginx_php [2025/02/16 13:53] (現在) – 外部編集 127.0.0.1
行 14: 行 14:
 {{page>nginx:install_centos6&noheader}} {{page>nginx:install_centos6&noheader}}
  
-===== PHP 5.3 =====+===== PHPと関連モジュール =====
 <code> <code>
- ● remiリポジトリを登録 +# yum -y --enablerepo=remi install php php-mbstring php-mysql php-pear php-devel 
-  # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm +# vi /etc/php.ini /etc/php.ini.org 
-   +869c869 
- ● PHP インストール +date.timezone = "Asia/Tokyo" 
-  # yum -y --enablerepo=remi install php +--- 
-  +> ;date.timezone 
-  +1350c1350 
-</code> +session.save_path = "/var/lib/php/session/" 
-===== PDO ===== +--- 
-<code> +;session.save_path = "/tmp" 
- # yum ---enablerepo=remi install php-pdo +ll /var/lib/php/ 
-  +合計 4 
-  +drwxrwx---. 2 root apache 4096 10月 16 17:24 2014 session 
-</code> +# chown -R root.nginx /var/lib/php/session 
-===== pear ===== +# ll /var/lib/php/ 
-<code+合計 4 
-yum ---enablerepo=remi install php-pear +drwxrwx---. 2 root nginx 4096 10月 16 17:24 2014 session
-  +
- +
 </code> </code>
 +
 ===== APC(PHP用アクセラレータ) ===== ===== APC(PHP用アクセラレータ) =====
 <code> <code>
- # yum -y --enablerepo=remi install php-devel +# yum -y --enablerepo=remi install gcc 
- # yum -y --enablerepo=remi install httpd-devel +# pecl install apc 
- # pecl install apc +# echo "extension=apc.so" | sudo tee /etc/php.d/apc.ini
- # echo "extension=apc.so" | sudo tee /etc/php.d/apc.ini +
-  +
-  +
-</code> +
-===== FastCGI ===== +
-<code> +
- ●参考サイト +
- http://ja.wikipedia.org/wiki/FastCGI +
-  +
- http://d.hatena.ne.jp/IT7C/20101003/1286082204 +
- > fpm(FastCGI Process Manager)はphpでFastCGIを使うための実装の一つです。 +
- > php 5.3.3でfpmが標準で使えるようになったので使ってみる。今まではphpに +
- > パッチを当てる必要がありました。ただし、標準になったとはいえ、PHPのコ +
- > ンパイル時にオプションの設定が必要なので、configureからやり直す必要が +
- > ある。尚、fpmのコンパイルするにあたって予め1.4系のlibeventをインストール +
- > しておく必要があります。 +
-  +
- ⇒ 5.3.4 では全く作業しなくても動いている。。。 +
- +
   
 </code> </code>
 +
 ===== PHP-FPM ===== ===== PHP-FPM =====
 <code> <code>
- ●参考サイト +# yum -y --enablerepo=remi install php-fpm 
- http://php.net/manual/ja/install.fpm.php +# vi /etc/php-fpm.d/www.conf 
-  +39c39 
- ● PHP-FPM インストール +< user = nginx 
- # yum ---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/default.conf 
- location ~ .php$ { + 
-     root           html; +9,10c9,10 
-     fastcgi_pass   127.0.0.1:9000; +<         root   /var/www/html; 
-     fastcgi_index  index.php; +<         index  index.php; 
-     fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name; +--- 
-     include        fastcgi_params; +>         root   /usr/share/nginx/html; 
-+>         index  index.html index.htm; 
-  +30,36c30,36 
- ● PHP-FPM 起動  +<     location ~ \.php$ { 
-/etc/rc.d/init.d/php-fpm start +<         root           /var/www/html; 
-  +<         fastcgi_pass   127.0.0.1:9000; 
- ● nginx 再起動(設定反映) +<         fastcgi_index  index.php; 
- /etc/init.d/nginx restart +<         fastcgi_param  SCRIPT_FILENAME  /var/www/html$fastcgi_script_name; 
-  +<         include        fastcgi_params; 
- ● 自動起動設定 +<     
-chkconfig php-fpm on +--- 
-  +>     #location ~ \.php$ { 
- ● ブラウザから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; 
 +>     #}
   
 +PHP-FPM 起動
 +# /etc/init.d/php-fpm start
 +自動起動設定
 +# chkconfig php-fpm on
 +
 +nginx 再起動(設定反映)
 +# /etc/init.d/nginx restart
 </code> </code>
 +
 ===== TokyoCabinet/TokyoTyrant ===== ===== TokyoCabinet/TokyoTyrant =====
 <code> <code>
centos/centos_nginx_php.1415153104.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)