Linux/Source/PHP
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
ns-lab
nowsky system-lab
DigiLoog
Linux
Windows
開始行:
*PHP [#o754150a]
[[PHP:+http://php.net/]]
色々なWebアプリを動かすのに必須なミドルウェア。LAMPの"P"...
PHP5.4以下とPHP5.5以上の間に開発の壁があり、5.4だと動いた...
また、現在のPHPオフィシャルメンテナー期間はメジャーバージ...
PHP5.7が公開されたら、オフィシャル版PHP5.4も終息となる予...
~
ただし、CentOSプロジェクトとか他メンテナーが絡んでいる物...
例:CentOSのyumのBaseリポジトリで提供しているPHP5.3はCent...
~
*インストール [#pb63c1ab]
&size(16){&font(b){0. ビルドオプション};};
長いオプションを使うので、オプションの意味は割愛。大体は...
以下は改行してあるが、実際には一行化した上でconfigure.opt...
『$ ./configure `cat ../configure.option`』とかにすると楽。
--prefix=/usr/local/php \
--sysconfdir=/etc \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-libdir=lib64 \
--with-curl=/usr/lib64 \
--with-jpeg-dir=/usr/lib64 \
--with-png-dir=/usr/lib64 \
--with-vpx-dir=/usr/lib64 \
--with-xpm-dir=/usr/lib64 \
--with-bz2 \
--with-gd \
--with-gettext \
--with-gmp \
--with-iconv \
--with-kerberos \
--with-layout \
--with-openssl \
--with-pic \
--with-xmlrpc \
--with-zlib \
--without-pspell \
--without-unixODBC \
--enable-bcmath \
--enable-calendar \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-intl \
--enable-mbstring \
--enable-pcntl \
--enable-pdo \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-xml \
--enable-xmlreader \
--enable-xmlwriter \
--enable-zip \
--disable-dba \
--disable-debug \
--disable-dom \
--disable-fileinfo \
--disable-phar \
--disable-posix \
--disable-rpath \
--disable-sysvmsg \
--disable-sysvsem \
--disable-sysvshm \
--disable-wddx
~
&size(16){&font(b){1. ビルド};};
上記のconfigureオプションを別ファイル化した場合のビルド例
# tar jxvf php-5.6.1.tar.bz2
# cd php-5.6.1
# ./configure `cat ../configure.option`
# make
# make test
# make install
~
&size(16){&font(b){2. 設定};};
ソースコードの中にphp.iniが入っているので、それを/etcにコ...
また、apacheとの連携をしている場合はhttpd.confにPHPのLoad...
# cp {$PHP_SrcDIR}/php.ini-development /etc/php.ini
『$ ./configure --sysconfdir=/etc』を外した場合はコンフィ...
&font(b){/usr/local/php/etcでは無い};ので注意
# cp {$PHP_SrcDIR}/php.ini-development /usr/local/php/li...
phpinfo()の結果「Loaded Configuration File」が「none」で&...
apacheのhttpd.confに下記設定を追加すれば、php.iniを直接指...
・PHP v7.X
---
<IfModule php7_module>
PHPIniDir /etc/php.ini
</IfModule>
・PHP v5.X
---
<IfModule php5_module>
PHPIniDir /etc/php.ini
</IfModule>
~
*エクステンション [#u5a13725]
アプリケーションによっては、外部エクステンション(拡張モジ...
PHPのソースに同梱されている物と、自前で用意する物の2種類...
#region(APCu)
- [[PECL Package APCu:+https://pecl.php.net/package/APCu]]
PHP経由でDB操作をする時、ローカルキャッシュを活かす場合に...
PDNS Managerで必須になるのでPHPをソースビルドした後に追加...
# wget https://pecl.php.net/get/apcu-5.1.12.tgz
# tar zxvf apcu-5.1.12.tgz
# cd apcu-5.1.12
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-c...
# make
# make install
# vi /etc/php.ini
---
extension=apcu.so
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=1
#endregion
終了行:
*PHP [#o754150a]
[[PHP:+http://php.net/]]
色々なWebアプリを動かすのに必須なミドルウェア。LAMPの"P"...
PHP5.4以下とPHP5.5以上の間に開発の壁があり、5.4だと動いた...
また、現在のPHPオフィシャルメンテナー期間はメジャーバージ...
PHP5.7が公開されたら、オフィシャル版PHP5.4も終息となる予...
~
ただし、CentOSプロジェクトとか他メンテナーが絡んでいる物...
例:CentOSのyumのBaseリポジトリで提供しているPHP5.3はCent...
~
*インストール [#pb63c1ab]
&size(16){&font(b){0. ビルドオプション};};
長いオプションを使うので、オプションの意味は割愛。大体は...
以下は改行してあるが、実際には一行化した上でconfigure.opt...
『$ ./configure `cat ../configure.option`』とかにすると楽。
--prefix=/usr/local/php \
--sysconfdir=/etc \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-libdir=lib64 \
--with-curl=/usr/lib64 \
--with-jpeg-dir=/usr/lib64 \
--with-png-dir=/usr/lib64 \
--with-vpx-dir=/usr/lib64 \
--with-xpm-dir=/usr/lib64 \
--with-bz2 \
--with-gd \
--with-gettext \
--with-gmp \
--with-iconv \
--with-kerberos \
--with-layout \
--with-openssl \
--with-pic \
--with-xmlrpc \
--with-zlib \
--without-pspell \
--without-unixODBC \
--enable-bcmath \
--enable-calendar \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-intl \
--enable-mbstring \
--enable-pcntl \
--enable-pdo \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-xml \
--enable-xmlreader \
--enable-xmlwriter \
--enable-zip \
--disable-dba \
--disable-debug \
--disable-dom \
--disable-fileinfo \
--disable-phar \
--disable-posix \
--disable-rpath \
--disable-sysvmsg \
--disable-sysvsem \
--disable-sysvshm \
--disable-wddx
~
&size(16){&font(b){1. ビルド};};
上記のconfigureオプションを別ファイル化した場合のビルド例
# tar jxvf php-5.6.1.tar.bz2
# cd php-5.6.1
# ./configure `cat ../configure.option`
# make
# make test
# make install
~
&size(16){&font(b){2. 設定};};
ソースコードの中にphp.iniが入っているので、それを/etcにコ...
また、apacheとの連携をしている場合はhttpd.confにPHPのLoad...
# cp {$PHP_SrcDIR}/php.ini-development /etc/php.ini
『$ ./configure --sysconfdir=/etc』を外した場合はコンフィ...
&font(b){/usr/local/php/etcでは無い};ので注意
# cp {$PHP_SrcDIR}/php.ini-development /usr/local/php/li...
phpinfo()の結果「Loaded Configuration File」が「none」で&...
apacheのhttpd.confに下記設定を追加すれば、php.iniを直接指...
・PHP v7.X
---
<IfModule php7_module>
PHPIniDir /etc/php.ini
</IfModule>
・PHP v5.X
---
<IfModule php5_module>
PHPIniDir /etc/php.ini
</IfModule>
~
*エクステンション [#u5a13725]
アプリケーションによっては、外部エクステンション(拡張モジ...
PHPのソースに同梱されている物と、自前で用意する物の2種類...
#region(APCu)
- [[PECL Package APCu:+https://pecl.php.net/package/APCu]]
PHP経由でDB操作をする時、ローカルキャッシュを活かす場合に...
PDNS Managerで必須になるのでPHPをソースビルドした後に追加...
# wget https://pecl.php.net/get/apcu-5.1.12.tgz
# tar zxvf apcu-5.1.12.tgz
# cd apcu-5.1.12
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-c...
# make
# make install
# vi /etc/php.ini
---
extension=apcu.so
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=1
#endregion
ページ名: