Windowsのphp5.4からphp5.6に更新する
探し方が悪いのか、更新する手順が見つからないので自分なりのメモ。
理由
phpのThread Sageとは
php5.6のApach2系のマルチスレッド対応なThread Safeを使う
http://windows.php.net/download/から
VC11 x64 Thread SafeをDL
php
既存のフォルダをリネーム、C:\phpをC:\php_old
DLした5.6をC:\phpにする
C:\php\php.ini-developmentをコピー、C:\php\php.iniとリネーム
date.timezone ="Asia/Tokyo"
コマンドプロンプトで「php -v」したら「MSVCR110.dllがないため、プログラムが開始できません」
Visual Studio 2012 更新プログラム 4 の Visual C++ 再頒布可能パッケージをインストール
「php -v」で「PHP 5.6.18」になった
apache
タスクトレイから「Apache Service Monitor」を起動、「Start」すると「Error The requested operation has failed!」
コマンドプロンプト
c:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin>httpd -t httpd: Syntax error on line 494 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/php/php5apache2_2.dll into server: \x8ew\x92\xe8\x82\xb3\x82\xea\x82\xbd\x83\x82\x83W\x83\x85\x81[\x83\x8b\x82\xaa\x8c\xa9\x82\xc2\x82\xa9\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B
phpのなかにphp5apache2_2.dllはなくてphp5apache2_4.dllならある。
しかたないのでapacheを2.2から2.4にする方針に変更
Apache LoungeからApache 2.4 binaries VC14の64bitをDL
httpd.confのコピーをとっておく
展開してReadMe.txtを読む
Upgrading --------- - Upgrading from 2.2.x see: httpd.apache.org/docs/2.4/upgrading.html and see httpd.apache.org/docs/2.4/new_features_2_4.html .
よくわからん。2.2をアンインストールしてから2.4をインストールする
C:\Apache24に入れた
C:\Apache24\conf\httpd.conf
ServerRoot "c:/Apache24" #そのまま Listen 8000 #80 ServerAdmin hoge@example.com #admin@example.com ServerName www.example.com:8000 #IISと同居のため
コマンドプロンプトで「c:\Appach24\bin\httpd.exe」で「コンピューターにVCRUNTIME140.dllがないため起動できません。」
Visual Studio 2015 の Visual C++ 再頒布可能パッケージ(2012じゃなくて2015ね)をインストール
「c:\Appach24\bin\httpd.exe」でブラウザで「http://localhost:8000/」にアクセス、「It works!」が出たらOK
c:\Apache24\bin>httpd -k install Installing the 'Apache2.4' service The 'Apache2.4' service is successfully installed. Testing httpd.conf.... Errors reported here must be corrected before the service can be started.
「Error」が気になってしらべたけど、よくわからん。
管理ツール>サービスで「Apache2.4」を開始
「Apache Service Monitor: C:\Apache24\bin\ApacheMonitor.exe」をスタートアップにぶち込む
腹減った
OSを再起動して昼飯
phpパート2
http://localhost:8000\phpinfo.php
見つからない。wordpressとかアクセスしても404になる。apacheのディレクトリを変更したのが原因
旧)C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
新)C:\Appach24\htdocs
phpinfo.phpが真っ白
php.iniの「short_open_tag = Off」を「On」、Apache再起動、だめ
httpd.confに追記
LoadModule php5_module C:/php/php5apache2_4.dll AddHandler application/x-httpd-php .php # php.ini へのパスを設定します PHPIniDir "C:/php"
wordpress
旧から新にwordpressフォルダをコピーする
http://localhost:8000/wordpress/ で 「Index o /wordpress ファイル一覧」になる
httpd.confに修正
<IfModule dir_module> # DirectoryIndex index.html DirectoryIndex index.html index.php </IfModule>
まだダメ。
php.ini
extension_dir = "C:\php\ext" extension=php_mbstring.dll extension=php_mysql.dll extension=php_mysqli.dll
やっと動いた。
ヘッダになにか出ている
Warning: mysql_get_server_info(): Access denied for user ''@'localhost' (using password: NO) in C:\Apache24\htdocs\wordpress\wp-content\plugins\advanced-category-excluder\advanced-category-excluder.php on line 128 Warning: mysql_get_server_info(): A link to the server could not be established in C:\Apache24\htdocs\wordpress\wp-content\plugins\advanced-category-excluder\advanced-category-excluder.php on line 128
wordpressの管理画面に入って「Advanced Category Exclude」を無効化した。
cybozu
サイボウズ10が動かん。旧のapache2.2\cgi-bin\cbagをバックアップする
アンインストール!!!
インストール!!apacheじゃなくてIISが選ばれているので、そのままやってみる。
うごかん
IISは7
うーん
IISマネージャー>Default Web Site>仮想ディレクトリの追加
エイリアス:scripts、物理パス:C:\inetpub\scripts
仮想ディレクトリを新規に作成する(IIS 7.0/7.5の場合)
ん、まてよ?
エイリアス:cybozu、物理パス:C:\inetpub\scripts\cbag、CGI-exe:実行OK、StaticFile:読み取り外し
動いた!!!!
エラー
データベースをバージョンアップする必要があります。
サーバー管理者の方へ:サイボウズ Officeを上書きインストールしてください。
インストーラーを起動して、「下の選択した製品」でアップデートすると治った!!