flagflag  
13: 2016-05-20 (Fri) 10:05:33 iseki source Cur: 2023-08-17 (Thu) 13:00:56 iseki source
Line 1: Line 1:
** PHP: Hypertext Preprocessor [#k50e5340] ** PHP: Hypertext Preprocessor [#k50e5340]
 +
*** Links [#b2d61ed1] *** Links [#b2d61ed1]
- http://www.php.net/ - http://www.php.net/
Line 5: Line 6:
- 日本PHPユーザー会 (Japan PHP User Group) - 日本PHPユーザー会 (Japan PHP User Group)
-- http://www.php.gr.jp/ -- http://www.php.gr.jp/
 +- 非推奨関数とか,本当勘弁してもらいたい.C言語を見習え!
 +#br
 +
 +*** Version [#r6fc27c8]
 +- [[PHP7 >./PHP7]]
 +- [[PHP8 >./PHP8]]
 +
#br #br
*** Install [#g3ac2181] *** Install [#g3ac2181]
-- --enable-intl を指定する場合は libicu-devel  (ユニコード用の国際化コンポーネント) が必要+- --enable-intl を指定する場合は libicu-devel  (ユニコード用の国際化コンポーネント) が必要 
 +- --enable-opcache  OPCache 使用 (5.5.x~) 
 +- MariaDBのライブラリに libmysqlclient を使用すると MYSQL_UNIX_ADDR未解決のコンパイルエラが発生する (5.6.36) 
 +-- DBのライブラリに mysqlnd を使用する 
 +- OpenSSL-1.1.x を使用している場合 
 +-- OpenSSL-1.1.x を使用している場合は, /usr/local/lib にライブラリが必要.シンボリックリンクを張っておく. 
 +-- OpenSSL-1.1.x を使用している場合は以下の様にしてから,configure を実行. 
 + cd /usr/local/ssl 
 + ln -s /usr/local/include . 
 + ln -s /usr/local/lib64 lib 
 + cd (php-source)
-- --enable-opcache  OPCache 使用 (5.5.x~)+- PHP-5.6 + OpenSSL-1.1 の場合は パッチを当てる.[[php56.36-openssl11.patch>http://www.nsl.tuis.ac.jp/DownLoad/SoftWare/PHP/php​56.36-openssl11.patch]] 
 +-- see also https://bugs.php.net/patch-display.php?b​ug_id=73741&patch=php56-openssl11&revisi​on=latest 
 +#br
 +**** configure [#la6d7565]
 # zcat php-5.x.y.tar.gz |tar xfv -  # zcat php-5.x.y.tar.gz |tar xfv -
 # cd php-5.x.y  # cd php-5.x.y
- # ./configure --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config + #./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
-                --with-pdo-mysql=/usr/local/mysql +              --with-apxs2=/usr/local/apache/bin/apxs
-                --with-apxs2=/usr/local/apache/bin/apxs +              --with-openssl=/usr/local/ssl --with-zlib=/usr
-                --enable-sockets --enable-zip --enable-soap --enable-pcntl +              --enable-mbstring --with-iconv --enable-intl
-                --enable-mbstring --with-iconv --enable-intl --enable-opcache +              --enable-zip --enable-soap --enable-pcntl
-                --with-zlib=/usr --with-openssl=/usr/local/ssl --with-curl --with-xmlrpc +              --enable-sockets --with-curl --with-xmlrpc --enable-opcache
-                --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir=/usr+              --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir=/usr
 # make  # make
 # make test  # make test
 # make install  # make install
 +
 +**** configure オプションの修正 [#u42ccc8f]
 +- PHP7 + OpenSSL1.1 の場合は --with-openssl=/usr/local
 +-- /usr/local/lib に openssl のライブラリが必要
 +- DBのライブラリに libmysqlclient を使用する場合は以下のオプションを指定
 + --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql​_config --with-pdo-mysql=/usr/local/mysql
*** 設定 [#y94248ee] *** 設定 [#y94248ee]
Line 50: Line 77:
- mb_internal_encoding("utf-8") は php.ini でも指定可能. - mb_internal_encoding("utf-8") は php.ini でも指定可能.
- SET NAMES utf8 でクエリの文字コードを指定可能. - SET NAMES utf8 でクエリの文字コードを指定可能.
 +#br
 +
 +*** PHP 関数拡張 [#q614929b]
 +- [[PHP Extension]]
 +- [[Sodium>PHP Extension/Sodium]]
 +#br
 +
 +*** Trouble Shooting [#t160986a]
 +**** エラーログ [#u1a71917]
 +- /etc/php.ini の error_log, log_errors で設定
 +- パーミッションに注意
 +
 + log_errors = On
 + error_log = /var/log/php/php.log
 +
 +- ただし php-fpm が動いている場合は,Web上でのエラーは error_log に出ない.
 +-- /var/log/php-fpm/www-error.log
 +
 +-- どこで指定してるんだ! ぷんぷん!
 +-- /etc/php-fpm.d/www.conf
 +
 + php_admin_value[error_log] = /var/log/php-fpm/www-error.log
 +
 +
 +#br
 +
 +**** dl() でモジュールを呼んでくれない [#v9ecf83f]
 +- php.ini で enable_dl = On とする.
 +#br
 +
 +**** php.ini の設定が反映されない [#df20ad07]
 +- php -i |grep php.ini  で PHPが実際に読み込んでいる php.ini を調べる
 +- PHPが WWWサーバのモジュールとしてではなく,php-fpm で動いている場合は,php-fpm を再起動する必要がある.
 + systemctl restart php-fpm
 +#br
 +
 +**** CetOS8 / Rocky Linux8 で PHPを 7.2から 7.4 にする [#l84ed33f]
 + dnf module list php
 + dnf module reset php
 + dnf module enable php:7.4 -y
 + yum erase php
 + yum install php --allowerasing
#br #br
*** PHP errors [#yba82631] *** PHP errors [#yba82631]
 +
**** opcache.so: undefined symbol: sapi_globals, opcache.so: undefined symbol: core_globals_id [#rb49ddd0] **** opcache.so: undefined symbol: sapi_globals, opcache.so: undefined symbol: core_globals_id [#rb49ddd0]
- yum でPHPを入れたまま,PHPの最新版をコンパイルして入れたら,ログに出力されるようになった. - yum でPHPを入れたまま,PHPの最新版をコンパイルして入れたら,ログに出力されるようになった.


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthMay 2024Next Month
Su Mo Tu We Th Fr Sa
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
Today

Who's Online

82 user(s) are online (39 user(s) are browsing xpwiki)

Members: 0
Guests: 82

more...

Access Counter

Today : 1824182418241824
Yesterday : 1361113611136111361113611
Total : 2364023123640231236402312364023123640231236402312364023123640231
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com