Welcome Guest 
メインメニュー
ご注文はうさぎですか?
TVアニメ「ご注文はうさぎですか?」公式サイト
アイドルマスター シンデレラガールズ
TVアニメ「アイドルマスター シンデレラガールズ」オフィシャルサイト
俺がお嬢様学校に「庶民サンプル」としてゲッツされた件
TVアニメ『俺がお嬢様学校に「庶民サンプル」としてゲッツされた件』公式サイト
ゆるゆり
アニメ「ゆるゆり」スペシャルサイト
落第騎士の英雄譚
TVアニメ 落第騎士の英雄譚 公式サイト
てーきゅう
TVアニメ「てーきゅう」
Free!-Eternal Summer-
TVアニメ『Free!』公式サイト
星刻の竜騎士
TVアニメーション「星刻の竜騎士」オフィシャルサイト
中二病でも恋がしたい!戀
TVアニメ『中二病でも恋がしたい!戀』公式サイト
そにアニ
そにアニ
境界の彼方
TVアニメ『境界の彼方』公式サイト
通信用語の基礎知識
通信用語の基礎知識

ブログ - FreeBSDのPHPのバージョンを、5.4系ではなく5.3系に留まる方法

FreeBSDのPHPのバージョンを、5.4系ではなく5.3系に留まる方法

カテゴリ : 
ICT、コンピュータ
執筆 : 
Fukuchan 2012/12/10 0:17
なんか最近のラノベみたいなタイトルですが・・・。

http://fukuchan.myhome.cx/modules/d3blog/details.php?bid=109 にもカキコしましたが、
FreeBSDのportsも、/usr/ports/lang/php5が、5.4系に変わりました。
新規にサーバを立ち上げる時は良いですが、既存のサーバで、PHPを5.3系で運営してきた場合、
PHPをアップデートすると、5.4系に変わってしまう可能性が・・・。

そうなると、依存portsにも影響がありますし、何より、上のレイヤーで動いているアプリケーションにも、
色々と問題が出てきます。(あっ、動かない・・・どうしよう。とか)

家の場合、xoopsが動いていますので、しばらくは5.3系を使っていたい訳でして。

って事で、
「FreeBSDで、PHPのバージョンを5.4系に上げずに、5.3系に留まりたいんだけど、どうしたらえぇですか?」的な、
無知の知なる黙示録の始まりー。

※ 下記の内容は、現在の私のスキルや環境に依存したものですので、参考程度に留めて下さい。苦情はよそへ。


まずは、portsのphp5のオリジン(って言うのか?)を、lang/php53に変更します。
私の場合、PHPのセキュリティアップデートが発生したタイミングで行いました。
アップデートに使用しているツールは、portmasterです。(portupgradeな人は、他のサイトを見て下され)

# portmaster -w -D -o lang/php53 lang/php5

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                     Options for php53 5.3.15                       x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x [ ] AP2FILTER  Use Apache 2.x filter interface (experimental)  x x
x x [X] APACHE     Build Apache module                             x x
    ↑ 付ける。環境に合わせて下さい。
x x [X] CGI        Build CGI version                               x x
x x [X] CLI        Build CLI version                               x x
x x [ ] DEBUG      Install debug symbols                           x x
x x [ ] FPM        Build FPM version (experimental)                x x
x x [X] IPV6       IPv6 support                                    x x
x x [ ] LINKTHR    Link thread lib (for threaded extensions)       x x
x x [ ] MAILHEAD   mail header patch                               x x
x x [X] MULTIBYTE  zend multibyte support                          x x
    ↑ 付ける。環境に合わせて下さい。
x x [X] SUHOSIN    Suhosin protection system                       x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu

===>>> The following actions will be taken if you choose to proceed:
        Install lang/php53
        Install devel/pkgconf

===>>> Proceed? y/n [y] y
  |
 (続く)
  |
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/libexec/apache22/libphp5.so
/usr/local/bin/php
/usr/local/bin/php-cgi

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
http://www.php.net/

===>  Cleaning for php53-5.3.15

===>>> Updating dependency entry for php53-5.3.15 in each dependent port
===>>> pkg-message for php53-5.3.15
***************************************************************

Make sure index.php is part of your DirectoryIndex.

You should add the following to your Apache configuration file:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

***************************************************************

===>>> Done displaying pkg-message files

===>>> The following actions were performed:
        Installation of devel/pkgconf (pkgconf-0.8.5)
        Installation of lang/php53 (php53-5.3.15)

portmaster -L の結果を確認してみます。
# portmaster -L

===>>> Branch ports (Have dependencies, are depended on)
===>>> php53-5.3.1
(一部を抜粋)

/usr/local/etc/ 下の、php関連の設定を確認・修正します。
php.ini-production に、細かい修正がありましたが、コメント部分なので、今回は無視する事にしました。
皆さんも適宜、調整して下さい。

次に、PHP に依存するものを、アップデートします。
下記の方法で、一つずつ、PHP に依存するものをアップデートしていきます。。
いや、もっと要領のよい方法があるんでしょうけど、一度にやると、大抵、トラブルに巻き込まれる体質なので、
一つずつ、確実に行っていきました。

皆さんの環境でも、php5-hogehogeな物を、php53-hogehogeにして下さい。

# portmaster -w -D -o archivers/php53-bz2 archivers/php5-bz2
# portmaster -w -D -o textproc/php53-ctype textproc/php5-ctype
# portmaster -w -D -o security/php53-filter security/php5-filter
# portmaster -w -D -o graphics/php53-gd graphics/php5-gd

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                   Options for php53-gd 5.3.15                      x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x         [ ] JIS       JIS-mapped Japanese font support         x x
x x         [X] T1LIB     Include T1lib support                    x x
x x         [X] TRUETYPE  TrueType string function                 x x
x x         [X] X11       X11 support                              x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                      Options for png 1.5.12                        x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x                 [X] APNG  Animated PNG support                 x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu

===>>> The following actions will be taken if you choose to proceed:
        Install graphics/php53-gd
        Upgrade png-1.4.11 to png-1.5.12
        Install devel/cmake
        Install devel/cmake-modules

===>>> Proceed? y/n [y] y
  |
 (続く)
  |
pkg_delete: package 'php5-gd-5.3.13' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
pecl-pdflib-2.1.8_1
phpMyAdmin-3.5.1

===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for graphics/php53-gd from ports
===>>> Dependency check complete for graphics/php53-gd
===>  Installing for php53-gd-5.3.15
===>   Generating temporary packing list
===>  Checking if graphics/php53-gd already installed
===>   Registering installation for php53-gd-5.3.15
****************************************************************************

The following line has been added to your /usr/local/etc/php/extensions.ini
configuration file to automatically load the installed extension:

extension=gd.so

****************************************************************************

===>  Cleaning for php53-gd-5.3.15

===>>> Updating dependency entry for php53-gd-5.3.15 in each dependent port
===>>> The following actions were performed:
        Installation of devel/cmake-modules (cmake-modules-2.8.8)
        Installation of devel/cmake (cmake-2.8.8_1)
        Upgrade of png-1.4.11 to png-1.5.12
        Installation of graphics/php53-gd (php53-gd-5.3.15)

頑張りましょう。

# portmaster -w -D -o devel/php53-json devel/php5-json
# portmaster -w -D -o converters/php53-mbstring converters/php5-mbstring

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                Options for php53-mbstring 5.3.15                   x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x               [X] REGEX  multibyte regex support               x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
# portmaster -w -D -o security/php53-mcrypt security/php5-mcrypt
# portmaster -w -D -o databases/php53-mysqli databases/php5-mysqli

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                 Options for php53-mysqli 5.3.15                    x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x             [X] MYSQLND  Use MySQL Native Driver"              x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
# portmaster -w -D -o security/php53-openssl security/php5-openssl
# portmaster -w -D -o www/php53-session www/php5-session
# portmaster -w -D -o archivers/php53-zip archivers/php5-zip
# portmaster -w -D -o archivers/php53-zlib archivers/php5-zlib

ここで、依存関係を確認してみます。
# pkg_info -R php53-5.3.15

Information for php53-5.3.15:

Required by:
pecl-APC-3.1.9_1
pecl-pdflib-2.1.8_1
php5-mysql-5.3.13
phpMyAdmin-3.5.1
php53-bz2-5.3.15
php53-ctype-5.3.15
php53-filter-5.3.15
php53-gd-5.3.15
php53-json-5.3.15
php53-mbstring-5.3.15
php53-mcrypt-5.3.15
php53-mysqli-5.3.15
php53-openssl-5.3.15
php53-session-5.3.15
php53-zip-5.3.15
php53-zlib-5.3.15

残りも頑張りましょう。

portmaster -w -D -o databases/php53-mysql databases/php5-mysql

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                  Options for php53-mysql 5.3.15                    x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x             [X] MYSQLND  Use MySQL Native Driver"              x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu
portmaster -w -D www/pecl-APC

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                   Options for pecl-APC 3.1.11                      x
x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
x x    [ ] FILEHITS    Per request cache info                      x x
x x    [ ] IPC         IPC shm memory support (default: mmap)      x x
x x    [ ] SEMAPHORES  System V IPC semaphores (default: fcntl)    x x
x x    [ ] SPINLOCKS   Spinlocks (experimental)                    x x
x x                                                                x x
tqmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjqu


****************************************************************************

===>  Cleaning for pecl-APC-3.1.11

===>>> Updating dependency entry for pecl-APC-3.1.11 in each dependent port
===>>> pkg-message for pecl-APC-3.1.11
************************************************************************
You may edit /usr/local/etc/php.ini to change this variables:

apc.enabled="1"
            ^^^ -> Default value

apc.shm_size="30"
             ^^^^ -> Default value

* More information on /usr/local/share/doc/APC/INSTALL

Then restart your web server and consult the output of phpinfo().
If there is an informational section for APC, the installation was
successful.
************************************************************************
portmaster -w -D print/pecl-pdflib

===>>> The following actions will be taken if you choose to proceed:
        Upgrade pecl-pdflib-2.1.8_1 to pecl-pdflib-2.1.9
        Upgrade pdflib-7.0.5 to pdflib-7.0.5_2

===>>> Proceed? y/n [y] y
  |
 (続く)
  |
===>>> Updating dependency entry for pecl-pdflib-2.1.9 in each dependent port
===>>> The following actions were performed:
        Upgrade of pdflib-7.0.5 to pdflib-7.0.5_2
        Upgrade of pecl-pdflib-2.1.8_1 to pecl-pdflib-2.1.9

この後、phpMyAdmin のアップデートもあるのですが、ここでは割愛させて頂きます。

アプリの動作確認をして終わりです。
お疲れ様でした。

トラックバック

トラックバックpingアドレス http://fukuchan.myhome.cx/modules/d3blog/tb.php/118
ブログ カレンダー
« « 2017 3月 » »
26 27 28 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
カテゴリ一覧
検索
D.S. -Dal Segno-
D.S. -Dal Segno-
リプキス
甘えかたは彼女なりに。
恋する乙女と守護の楯~薔薇の聖母~
AXL新作第12弾「恋する乙女と守護の楯~薔薇の聖母~」 2016年1月29日発売予定!
Powered by XOOPS Cube Legacy 2.2 © 2001-2009 XOOPS Cube日本サイト