2015年2月10日火曜日

PHP の研究を再開することにした

2015.02.10(火) 

■ PHP の研究を再開することにした。
2015.02.05(木)
PHP:The Right Wayの説明:http://www.s-arcana.co.jp/tech/
■ 過去にPHP の研究を試みたことがある。
2014.08.04(月)
/Volumes/LaCie/デスクトップ2/諸資料記録/処理中/緊急処理中/研究中2014.08.03〜/PHP56インストール
■ Homeblew で行ったPHP56インストールは旨くいかなかったので削除した。
■ MacPorts での PHP56インストールを行うことにした。
2015.02.06(金)
■ MacPorts のインストール
■ /Users/kojimac.../.bash_profile
・・・・・・・・・・
##
# Your previous /Users/kojimac.../.bash_profile file was backed up as /Users/kojimatac.../.bash_profile.macports-saved_2015-02-06_at_10:12:19
##
# MacPorts Installer addition on 2015-02-06_at_10:12:19: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
##
# Your previous /Users/kojimac.../.bash_profile file was backed up as /Users/kojimatac.../.bash_profile.macports-saved_2015-02-06_at_10:42:18
##
# MacPorts Installer addition on 2015-02-06_at_10:42:18: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
■ $sudo port selfupdate
Password:
---> Updating MacPorts base sources using rsync
MacPorts base version 2.3.3 installed,
MacPorts base version 2.3.3 downloaded.
---> Updating the ports tree
---> MacPorts base is already the latest version
The ports tree has been updated. To upgrade your installed ports, you should run
port upgrade outdated
10:48 AM kojiMacBook-Air:~
■ $port
MacPorts 2.3.3
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/kojimatakumi] > 
■ $bash
11:33 AM kojiMacBook-Air:~
■ $sudo port install php56
Password:
To customize php56, copy /opt/local/etc/php56/php.ini-development (if this is a
development server) or /opt/local/etc/php56/php.ini-production (if this is a
production server) to /opt/local/etc/php56/php.ini and then make changes.
---> Cleaning php56
---> Updating database of binaries
---> Scanning binaries for linking errors 
---> No broken files found.
11:34 AM kojiMacBook-Air:~
■ $sudo port select php php56
Selecting 'php56' for 'php' succeeded. 'php56' is now active.
11:35 AM kojiMacBook-Air:~
■ $php -v
PHP 5.6.5 (cli) (built: Jan 24 2015 18:02:57) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
11:35 AM kojiMacBook-Air:~
■ ApacheからPHP5.6を使うように書き換え
/private/etc/apache2/httpd.conf
169LoadModule php5_module libexec/apache2/libphp5.so
■ php.ini ファイルを設定する
■ php.ini を作成する。
To customize php56, copy /opt/local/etc/php56/php.ini-development (if this is a
development server) or /opt/local/etc/php56/php.ini-production (if this is a
production server) to /opt/local/etc/php56/php.ini and then make changes.
■ php.ini-development の複製から php.ini を作成した。
この php.ini を /private/etc/php.ini として移行保存。元の php.ini は /private/etc/php.ini-5.5.1.4~org として保存。
/opt/local/etc/php56/php.ini は php-org.ini と名前を変更し保存。
■ MacPorts を導入したので、Homebrew の具合を確かめる。
■ $brew doctor
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/opt/local/bin/ncurses5-config
/opt/local/bin/ncursesw5-config
/opt/local/bin/pcre-config
/opt/local/bin/php-config
/opt/local/bin/xml2-config
Warning: You have MacPorts or Fink installed:
/opt/local/bin/port
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
◥◣ sudo mv /opt/local ~/macports
■ Homebrew を利用するには MacPorts の退避が必要
◼ 差し当たりどちらも使う予定がないので唯保守のためにこのままにしておく。
■ PHP56 導入後に発生したトラブル
◼ 予期せぬエラーが発生しました。
SQLSTATE[HY000] [2002] No such file or directory
◼ ログイン出来ない。
localhost/phpmyadmin/
■ トラブルの原因究明
◼ PHP56 をインストールしたため php.ini がデフォルトに戻っていると考えられるので、ソケットの設定がなされているか調べる。
◼ 参考になるのは過去に php.ini がデフォルトしたときの処理経過記録である。
◼ 2014.11.08(土)php.ini がデフォルトしたときの処理経過記録。
◼php.ini 設定
986pdo_mysql.default_socket=/tmp/mysql.sock
1135 mysql.default_socket = /tmp/mysql.sock
1194 mysqli.default_socket = /tmp/mysql.sock
■ トラブルの修復
◼ php.ini ー etc 設定がデフォルトしたため改めて次を設定した。
980pdo_mysql.default_socket=/tmp/mysql.sock
1129mysql.default_socket = /tmp/mysql.sock
1188mysqli.default_socket = /tmp/mysql.sock
■ トラブルの修復結果
◼ ログインocalhost/phpmyadmin/

0 件のコメント:

コメントを投稿