<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Development memo &#187; PHP</title>
	<atom:link href="http://officesoya.net/weblog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://officesoya.net/weblog</link>
	<description>Rough Consensus　And Running code</description>
	<lastBuildDate>Mon, 21 Jun 2010 09:22:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/category/php/feed/" />
		<item>
		<title>とても気になっていたorder.phpでエラー(v1.4.0)</title>
		<link>http://officesoya.net/weblog/2010/03/14/order-php_error/</link>
		<comments>http://officesoya.net/weblog/2010/03/14/order-php_error/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 19:50:38 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[日本語化]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=186</guid>
		<description><![CDATA[catalog/model/checkout/order.php
の155行目

if ($order_query-&#62;row['payment_address_format']) {
 $format = $order_info['payment_address_format'];
 }


if ($order_query-&#62;row['payment_address_format']) {
 $format = $order_query-&#62;row['payment_address_format'];
 }

これだけでは$order_query-&#62;row['payment_address_format']の
値を取得できないので、さらに4行目のクエリを一部変更

public function getOrder($order_id) {
 $query = $this-&#62;db-&#62;query(&#34;SELECT *, c1.iso_code_2 AS shipping_iso_code_2, c1.iso_code_3 AS shipping_iso_code_3, c2.iso_code_2 AS payment_iso_code_2, c2.iso_code_3 AS shipping_iso_code_3, z1.code AS shipping_zone_code, z2.code AS payment_zone_code FROM `&#34; . DB_PREFIX . &#34;order` o LEFT JOIN &#34; . DB_PREFIX . &#34;country c1 ON (o.shipping_country_id [...]]]></description>
			<content:encoded><![CDATA[<p>catalog/model/checkout/order.php</p>
<p>の155行目</p>
<pre class="brush: php;">
if ($order_query-&gt;row['payment_address_format']) {
 $format = $order_info['payment_address_format'];
 }
</pre>
<pre class="brush: php;">
if ($order_query-&gt;row['payment_address_format']) {
 $format = $order_query-&gt;row['payment_address_format'];
 }
</pre>
<p>これだけでは<code>$order_query</code><code>-&gt;row[</code><code>'payment_address_format'</code><code>]の</code></p>
<p>値を取得できないので、さらに4行目のクエリを一部変更</p>
<pre class="brush: php;">
public function getOrder($order_id) {
 $query = $this-&gt;db-&gt;query(&quot;SELECT *, c1.iso_code_2 AS shipping_iso_code_2, c1.iso_code_3 AS shipping_iso_code_3, c2.iso_code_2 AS payment_iso_code_2, c2.iso_code_3 AS shipping_iso_code_3, z1.code AS shipping_zone_code, z2.code AS payment_zone_code FROM `&quot; . DB_PREFIX . &quot;order` o LEFT JOIN &quot; . DB_PREFIX . &quot;country c1 ON (o.shipping_country_id = c1.country_id) LEFT JOIN &quot; . DB_PREFIX . &quot;country c2 ON (o.payment_country_id = c2.country_id) LEFT JOIN &quot; . DB_PREFIX . &quot;zone z1 ON (o.shipping_zone_id  = z1.zone_id) LEFT JOIN &quot; . DB_PREFIX . &quot;zone z2 ON (o.payment_zone_id = z2.zone_id) WHERE o.order_id = '&quot; . (int)$order_id . &quot;'&quot;);

 return $query-&gt;row;
 }
</pre>
<p>一番うしろのほうの</p>
<p>zone z1 ON (o.payment_zone_id  = z1.zone_id)</p>
<p>だったのを</p>
<p>zone z1 ON (o.shipping_zone_id  = z1.zone_id)</p>
<p>に変更してます。</p>
<p>といっても既に1.4.3にバージョンアップしてる・・・バージョンアップについていけなくなってきました。</p>
<p>OpenCart本家を参照：http://forum.opencart.com/viewtopic.php?f=31&amp;t=9041&amp;p=42779&amp;hilit=ModelCheckoutOrder#p42779<!--ｐ--></p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2010/03/14/order-php_error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2010/03/14/order-php_error/" />
	</item>
		<item>
		<title>OpenCartのfilemanegerでフォルダが表示されない（IE）</title>
		<link>http://officesoya.net/weblog/2010/03/08/opencart1-4-0bug/</link>
		<comments>http://officesoya.net/weblog/2010/03/08/opencart1-4-0bug/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 05:01:51 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=184</guid>
		<description><![CDATA[Firefoxは問題ないが、IEではフォルダが表示されない。OpenCart　v1.4.0
原因はjavascriptにあった。
admin/view/template/common/filamanger.tpl
の13 [...]]]></description>
			<content:encoded><![CDATA[<pre>Firefoxは問題ないが、IEではフォルダが表示されない。OpenCart　v1.4.0
原因はjavascriptにあった。
admin/view/template/common/filamanger.tpl
の130行目
<pre class="brush: jscript;">
valid_children : 'all',
</pre>
<p>allの後の「,」を削除する
<pre class="brush: jscript;">
valid_children : 'all'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2010/03/08/opencart1-4-0bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2010/03/08/opencart1-4-0bug/" />
	</item>
		<item>
		<title>カラーミーで大カテゴリーの下に小カテゴリーの一覧を表示する</title>
		<link>http://officesoya.net/weblog/2009/12/14/%e3%82%ab%e3%83%a9%e3%83%bc%e3%83%9f%e3%83%bc%e3%81%a7%e5%a4%a7%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae%e4%b8%8b%e3%81%ab%e5%b0%8f%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae/</link>
		<comments>http://officesoya.net/weblog/2009/12/14/%e3%82%ab%e3%83%a9%e3%83%bc%e3%83%9f%e3%83%bc%e3%81%a7%e5%a4%a7%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae%e4%b8%8b%e3%81%ab%e5%b0%8f%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 06:42:37 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[カラーミー]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=170</guid>
		<description><![CDATA[カラーミーでは小カテゴリーの中に商品を全部振り分けてしまうと大カテゴリーのリンクをクリックしても小カテゴリーの一覧が表示されるだけで小カテゴリーの商品は一覧表示されない。
大カテゴリーをクリックした先で小カテゴリーに登録されている商品一覧を表示させたいというカスタマイズ依頼のメモ。
カテゴリーを画像表示することが原則です。
「商品検索結果ページ」の上部に下記のようにしてcategory_id とctという変数をアサインする。
$search_category という変数に大カテゴリーの名前が入ってくるのでそれをif文で振り分ける。
category_id は大カテゴリーのIdを、
ctは大カテゴリーに属する小カテゴリーの数を入力する。

&#60;{if $search_category == &#34;MEN'S WEAR&#34; }&#62;
&#60;{assign var=&#34;category_id&#34; value=&#34;787440&#34;}&#62;
&#60;{assign var=&#34;ct&#34; value=&#34;8&#34;}&#62;

&#60;{elseif $search_category == &#34;LADIE'S WEAR&#34; }&#62;
&#60;{assign var=&#34;category_id&#34; value=&#34;787441&#34;}&#62;
&#60;{assign var=&#34;ct&#34; value=&#34;9&#34;}&#62;
・
・
・
&#60;{elseif $search_category == &#34;OTHERS&#34; }&#62;
&#60;{assign var=&#34;category_id&#34; value=&#34;787443&#34;}&#62;
&#60;{assign var=&#34;ct&#34; value=&#34;4&#34;}&#62;
&#60;{/if}&#62;

その後ctがアサインされているかどうかで検索結果とするのか大カテゴリーの一覧表示とするのか
振り分ける。
さらにiとｋという変数を作り初期値に1をいれてループの回数（$ct）回るたびにインクリメント
させると”&#60;{$category_id}&#62;_&#60;{$i++}&#62;.jpg&#8221;で画像が取得できる。リンクは”?mode=cate&#38;cbid=&#60;{$category_id}&#62;&#38;csid=&#60;{$k++}&#62;”です。

&#60;{if isset($ct)}&#62;
&#60;a href=&#34;./&#34;&#62;TOP&#60;/a&#62; &#62; &#60;a href='/?mode=srh&#38;amp;amp;cid=&#60;{$category_id}&#62;%2C0'&#62;&#60;{$search_category}&#62;&#60;/a&#62;
&#60;!--// パンくずナビ --&#62;
&#60;{assign var=&#34;i&#34; value=&#34;1&#34;}&#62;
&#60;{assign var=&#34;k&#34; value=&#34;1&#34;}&#62;
&#60;div id=&#34;subcate&#34;&#62;&#60;div class=&#34;title&#34;&#62;sub categories&#60;/div&#62;

&#60;{section name=cate loop=$ct }&#62;
&#60;div style=&#34;float: left;margin:10px 12px 0 0;&#34;&#62;
&#60;a href=&#34;?mode=cate&#38;amp;amp;cbid=&#60;{$category_id}&#62;&#38;amp;amp;csid=&#60;{$k++}&#62;&#34;&#62;
&#60;img src=&#34;http://img15.shop-pro.jp/PA01084/170/category/&#60;{$category_id}&#62;_&#60;{$i++}&#62;.jpg&#34;&#62;&#60;/a&#62;&#38;amp;amp;nbsp;&#38;amp;amp;nbsp;
&#60;/div&#62;

&#60;{/section}&#62;
&#60;br class=&#34;clear&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>カラーミーでは小カテゴリーの中に商品を全部振り分けてしまうと大カテゴリーのリンクをクリックしても小カテゴリーの一覧が表示されるだけで小カテゴリーの商品は一覧表示されない。<br />
大カテゴリーをクリックした先で小カテゴリーに登録されている商品一覧を表示させたいというカスタマイズ依頼のメモ。<br />
カテゴリーを画像表示することが原則です。<br />
「商品検索結果ページ」の上部に下記のようにしてcategory_id とctという変数をアサインする。<br />
$search_category という変数に大カテゴリーの名前が入ってくるのでそれをif文で振り分ける。<br />
category_id は大カテゴリーのIdを、<br />
ctは大カテゴリーに属する小カテゴリーの数を入力する。</p>
<pre class="brush: xml;">
&lt;{if $search_category == &quot;MEN'S WEAR&quot; }&gt;
&lt;{assign var=&quot;category_id&quot; value=&quot;787440&quot;}&gt;
&lt;{assign var=&quot;ct&quot; value=&quot;8&quot;}&gt;

&lt;{elseif $search_category == &quot;LADIE'S WEAR&quot; }&gt;
&lt;{assign var=&quot;category_id&quot; value=&quot;787441&quot;}&gt;
&lt;{assign var=&quot;ct&quot; value=&quot;9&quot;}&gt;
・
・
・
&lt;{elseif $search_category == &quot;OTHERS&quot; }&gt;
&lt;{assign var=&quot;category_id&quot; value=&quot;787443&quot;}&gt;
&lt;{assign var=&quot;ct&quot; value=&quot;4&quot;}&gt;
&lt;{/if}&gt;
</pre>
<p>その後ctがアサインされているかどうかで検索結果とするのか大カテゴリーの一覧表示とするのか<br />
振り分ける。<br />
さらにiとｋという変数を作り初期値に1をいれてループの回数（$ct）回るたびにインクリメント<br />
させると”&lt;{$category_id}&gt;_&lt;{$i++}&gt;.jpg&#8221;で画像が取得できる。リンクは”?mode=cate&amp;cbid=&lt;{$category_id}&gt;&amp;csid=&lt;{$k++}&gt;”です。</p>
<pre class="brush: xml;">
&lt;{if isset($ct)}&gt;
&lt;a href=&quot;./&quot;&gt;TOP&lt;/a&gt; &gt; &lt;a href='/?mode=srh&amp;amp;amp;cid=&lt;{$category_id}&gt;%2C0'&gt;&lt;{$search_category}&gt;&lt;/a&gt;
&lt;!--// パンくずナビ --&gt;
&lt;{assign var=&quot;i&quot; value=&quot;1&quot;}&gt;
&lt;{assign var=&quot;k&quot; value=&quot;1&quot;}&gt;
&lt;div id=&quot;subcate&quot;&gt;&lt;div class=&quot;title&quot;&gt;sub categories&lt;/div&gt;

&lt;{section name=cate loop=$ct }&gt;
&lt;div style=&quot;float: left;margin:10px 12px 0 0;&quot;&gt;
&lt;a href=&quot;?mode=cate&amp;amp;amp;cbid=&lt;{$category_id}&gt;&amp;amp;amp;csid=&lt;{$k++}&gt;&quot;&gt;
&lt;img src=&quot;http://img15.shop-pro.jp/PA01084/170/category/&lt;{$category_id}&gt;_&lt;{$i++}&gt;.jpg&quot;&gt;&lt;/a&gt;&amp;amp;amp;nbsp;&amp;amp;amp;nbsp;
&lt;/div&gt;

&lt;{/section}&gt;
&lt;br class=&quot;clear&quot; /&gt;
&lt;/div&gt;
&lt;{else}&gt;

&lt;br class=&quot;clear&quot; /&gt;
&lt;!-- ページタイトル --&gt;
&lt;strong&gt;｜検索結果&lt;/strong&gt;

&lt;br /&gt;
&amp;amp;amp;nbsp;&amp;amp;amp;nbsp;ヒット件数：&lt;strong&gt;&lt;{$productlist_num}&gt;&lt;/strong&gt;件
&lt;br /&gt;
検索条件　[カテゴリー]：&lt;{if $search_category!=&quot;&quot;}&gt;&lt;strong&gt;&lt;{$search_category}&gt;&lt;/strong&gt;&lt;{/if}&gt;
&amp;amp;amp;nbsp;&amp;amp;amp;nbsp;[検索文字]：&lt;{if $search_keyword!=&quot;&quot;}&gt;&lt;strong&gt;&lt;{$search_keyword}&gt;&lt;/strong&gt;&lt;{/if}&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;{/if}&gt;
</pre>
<p>商品一覧、商品詳細ページのパンくずリストも変更が必要なため、以下のように変更。</p>
<p>ここにはグループ名がくることもあるのでグループID（$group_id）もアサインしてif文で振り分ける。</p>
<pre class="brush: xml;">
&lt;{if $search_category == &quot;MEN'S WEAR&quot; }&gt;
&lt;{assign var=&quot;category_id&quot; value=&quot;787440&quot;}&gt;

&lt;{elseif $search_category == &quot;LADIE'S WEAR&quot; }&gt;

&lt;{assign var=&quot;category_id&quot; value=&quot;787441&quot;}&gt;

・
・
&lt;{elseif $bid_name == &quot;sassy&quot; }&gt;
&lt;{assign var=&quot;group_id&quot; value=&quot;67887&quot;}&gt;
&lt;{elseif $bid_name == &quot;conbi&quot; }&gt;
&lt;{assign var=&quot;group_id&quot; value=&quot;67888&quot;}&gt;
・
・
&lt;{elseif $search_category == &quot;OTHERS&quot; }&gt;
&lt;{assign var=&quot;category_id&quot; value=&quot;787443&quot;}&gt;
&lt;{/if}&gt;
&lt;{ if $product.id != &quot;&quot; }&gt;
&lt;!-- パンくずナビ --&gt;
&lt;a href=&quot;./&quot;&gt;TOP&lt;/a&gt; &lt;{if $category_id!=&quot;&quot;}&gt;&amp;gt; &lt;a href='?mode=srh&amp;cid=&lt;{$category_id}&gt;%2C0'&gt;&lt;{$bid_name}&gt;&lt;/a&gt;&lt;{elseif $group_id!=&quot;&quot;}&gt;
&amp;gt; &lt;a href='?mode=grp&amp;gid=&lt;{$group_id}&gt;'&gt;&lt;{$bid_name}&gt;&lt;/a&gt;&lt;{/if}&gt;&lt;{if $sid_name != &quot;&quot;}&gt; &amp;gt; &lt;a href='&lt;{$sid_link}&gt;'&gt;&lt;{$sid_name}&gt;&lt;/a&gt;&lt;{/if}&gt;&lt;{if $product_name != &quot;&quot;}&gt; &amp;gt; &lt;a href='&lt;{$product_link}&gt;'&gt;&lt;{$product_name}&gt;&lt;/a&gt;&lt;{/if}&gt;
&lt;!--// パンくずナビ --&gt;
&lt;br /&gt;
・
・
・
</pre>
<p>完全自動ではないが、HTMLを全部書き出すよりはイイ！<br />
画像登録はカテゴリー管理から登録すること。</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2009/12/14/%e3%82%ab%e3%83%a9%e3%83%bc%e3%83%9f%e3%83%bc%e3%81%a7%e5%a4%a7%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae%e4%b8%8b%e3%81%ab%e5%b0%8f%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2009/12/14/%e3%82%ab%e3%83%a9%e3%83%bc%e3%83%9f%e3%83%bc%e3%81%a7%e5%a4%a7%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae%e4%b8%8b%e3%81%ab%e5%b0%8f%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%83%bc%e3%81%ae/" />
	</item>
		<item>
		<title>php.iniのmbstringで設定した文字コードとスクリプトの文字コードが違う場合の文字化け</title>
		<link>http://officesoya.net/weblog/2009/04/28/phpini/</link>
		<comments>http://officesoya.net/weblog/2009/04/28/phpini/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 11:37:24 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mbstring]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[文字化け]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=152</guid>
		<description><![CDATA[だいぶ前に作成したプログラムを久々に動かしてみたところ、EUC-JPで作成されていたため（php.iniの文字コード設定はUTF-8 ）ブラウザで表示されるたびに文字化けが起こる。ブラウザの「表示」→「エンコード」でEU [...]]]></description>
			<content:encoded><![CDATA[<p>だいぶ前に作成したプログラムを久々に動かしてみたところ、EUC-JPで作成されていたため（php.iniの文字コード設定はUTF-8 ）ブラウザで表示されるたびに文字化けが起こる。ブラウザの「表示」→「エンコード」でEUC-JPに直せば問題なく表示できるのだが、ページを遷移したりリロードするたびに直さなくてはならない。</p>
<p>その際のおまじないがこちら。</p>
<pre class="brush: php;">
mb_http_output('EUC-JP');
mb_internal_encoding('EUC-JP');
ini_set(&quot;default_charset&quot;, &quot;EUC-JP&quot;);
</pre>
<p>これをすべてのスクリプトが読み込む部分に記述した。文字コードがphp.iniと合っていたとしても上記のように記述しておくと環境が変わっても文字化けしなくてよいかも、と思った。ちなみにUTF-8の場合は下記のように。</p>
<pre class="brush: php;">
mb_http_output('UTF8');
mb_internal_encoding('UTF8');
ini_set(&quot;default_charset&quot;, &quot;UTF8&quot;);
</pre>
<p>文字化けなんて、もうしない！</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2009/04/28/phpini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2009/04/28/phpini/" />
	</item>
		<item>
		<title>phpのバージョンが変わらない[Windows php5.2.9]</title>
		<link>http://officesoya.net/weblog/2009/04/11/php_varsion_up/</link>
		<comments>http://officesoya.net/weblog/2009/04/11/php_varsion_up/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 15:19:29 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[バージョンアップ]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=148</guid>
		<description><![CDATA[かなりはまりました。phpとApacheのインストールはWindows Serverで何十回も行っているのですが、バージョンアップは初でした。で、はまりました。
以前のバージョンはPHP5.2.3なんですが今回バージョン [...]]]></description>
			<content:encoded><![CDATA[<p>かなりはまりました。phpとApacheのインストールはWindows Serverで何十回も行っているのですが、バージョンアップは初でした。で、はまりました。</p>
<p>以前のバージョンはPHP5.2.3なんですが今回バージョンアップを試み最新バージョン（PHP5.2.9）のインストーラーをダウンロードしてきました。バージョンアップする必要なし！というつっこみはおいといて･･･</p>
<p>で、以前のバージョンのはインストーラではなくてバイナリをダウンロードしてきたものでしたので、そのままゴミ箱へ。そして最新バージョンのをインストーラーでインストール。でApache再起動でOK！と思っていました。</p>
<p>でも、phpinfo()でみると以前のバージョンのまま・・・なぜ？？</p>
<p>PHP何度も削除してインストールしてを繰り返しましたが結局だめでした。最終的にはバイナリ版を持ってきて丸ごとフォルダにコピーしてもやっぱりバージョンは変わらない･･･</p>
<p>コマンドラインから　php -v</p>
<p>とやると、PHP5.2.9と出るんです。でもphpinfo()だとPHP5.2.3と出るんです･･･。</p>
<p>でもって</p>
<p>echo phpversion();</p>
<p>でも　PHP5.2.3と出るんです。</p>
<p>echo PHP_VERSION</p>
<p>でも　PHP5.2.3と出るんですよ。</p>
<p>でも、解決しました。原因はバイナリ版を以前コピペでインストールしたとき、php.iniとphp5ts.dllがC:\WINDOWSにコピーしてあったんです。それがPHP5.2.3を表示させている原因でした。php.iniはこの現象の原因とは関係ないですが。</p>
<p>C:\WINDOWSにあるphp5ts.dllを削除<br />
ついでにC:\WINDOWS\php.iniも紛らわしいので削除（インストーラではphp.iniはphpをインストールしたディレクトリに置かれ、Apacheのhttpd.confに勝手にINI_PATHを書き込んでくれるため）</p>
<p>解決！4時間くらい悩みました。</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2009/04/11/php_varsion_up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2009/04/11/php_varsion_up/" />
	</item>
		<item>
		<title>Windows vistaでApache2.2.11 &amp; php5.2.8　のインストール</title>
		<link>http://officesoya.net/weblog/2009/02/24/windows-vista%e3%81%a7apache2211-php528%e3%80%80%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/</link>
		<comments>http://officesoya.net/weblog/2009/02/24/windows-vista%e3%81%a7apache2211-php528%e3%80%80%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:43:29 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[vista]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=136</guid>
		<description><![CDATA[よくApache &#38; php　をインストールするが、今回は初めてVistaにインストールした。いつもはWindowsServerなのでMssqlだが、今回はExtensionにMysqlを追加した。
全部で追加し [...]]]></description>
			<content:encoded><![CDATA[<p>よくApache &amp; php　をインストールするが、今回は初めてVistaにインストールした。いつもはWindowsServerなのでMssqlだが、今回はExtensionにMysqlを追加した。</p>
<p>全部で追加したモジュールは以下の通り</p>
<ul>
<li>GD2</li>
<li>Mysql</li>
<li>OpenSSL</li>
<li>Mbstring</li>
<li>PEAR(Extension)</li>
</ul>
<p>まず、Apacheをインストーラから問題なくインストール。次にphpのインストールだが、vistaにはphpのインストーラーが使えなかった（原因不明：zipパッケージを使うほうが好きなので追及しなかった）。</p>
<p>で、インストーラを早々とあきらめ、zipファイルを本家よりダウンロードして解凍してProgram Filesの中にコピー。</p>
<p>Apache のhttpd.confの一番最後に</p>
<p>PHPIniDir &#8220;C:/Program Files/php/&#8221;<br />
LoadModule php5_module &#8220;C:/Program Files/php/php5apache2_2.dll&#8221;<br />
AddType application/x-httpd-php .php</p>
<p>を追加した。</p>
<p>そして次にphp.ini-dist をコピーしてphp.iniに書き換え、634行目からの</p>
<p>extension=php_gd2.dll<br />
extension=php_mbstring.dll<br />
extension=php_mysql.dll<br />
extension=php_openssl.dll</p>
<p>の使いたいモジュールを追加。そしてApache 再起動して、動作確認・・・のはずが動かない。<br />
Apacheのエラーログを見ると原因がわかった。</p>
<p>PHP Startup: Unable to load dynamic library php_gd2.dll&#8217;&#8230;<br />
PHP Startup: Unable to load dynamic library php_mbstring.dll&#8217;&#8230;<br />
PHP Startup: Unable to load dynamic library php_openssl.dll&#8217;&#8230;<br />
PHP Startup: Unable to load dynamic library php_mysql.dll&#8217;&#8230;</p>
<p>というエラーが出ていた。php.iniに戻って<br />
extension_dirの値を見てみるとデフォルトで</p>
<p>extension_dir = &#8220;./&#8221;</p>
<p>となっていたので、フルパス</p>
<p>extension_dir = &#8220;C:/Program Files/php/ext/&#8221;</p>
<p>に変更した。Apacheを再起動してみると、MysqlのExtensionだけ読み込まれていないエラーが出た（Apacheのerror.log）。</p>
<p>何度確かめても名前は間違ってないし、パスもあっているし、ファイルも存在するし・・・と悩んだ挙句、MySQLのクライアントライブラリである libmysql.dll がWindowsのパスの通る場所においてないといけないということがわかった。</p>
<p>libmysql.dll は既に、PHPのインストールフォルダ直下にあったので、C:/Windows/Sytem32/にコピーしてApache再再起動（何度やったか分からない）。</p>
<p>（補足）PHPのインストールフォルダに環境変数のPATHを通せばSystem32にコピーしなくてもよい。</p>
<p>というか、WAMPをインストールしたほうが早いという意見もあるが、やったことないし。</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2009/02/24/windows-vista%e3%81%a7apache2211-php528%e3%80%80%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2009/02/24/windows-vista%e3%81%a7apache2211-php528%e3%80%80%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/" />
	</item>
		<item>
		<title>Opencartがバージョンアップしました</title>
		<link>http://officesoya.net/weblog/2009/02/20/opencart_/</link>
		<comments>http://officesoya.net/weblog/2009/02/20/opencart_/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 08:43:21 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=134</guid>
		<description><![CDATA[Opencart v1.1.8　がリリースされましたね。
早速見てみましたが、Modelディレクトリに以前は何も入っていなかったのですが、モデルクラスが追加されていました。
プログラムコードもだいぶ改良されていて、以前よ [...]]]></description>
			<content:encoded><![CDATA[<p>Opencart v1.1.8　がリリースされましたね。</p>
<p>早速見てみましたが、Modelディレクトリに以前は何も入っていなかったのですが、モデルクラスが追加されていました。</p>
<p>プログラムコードもだいぶ改良されていて、以前より、ソースコードが短くて済みます。より、フレームワークになったって感じです。</p>
<p>管理者画面も、以前は画像と商品を別々にアップロードしなくてはなりませんでしたが、今度のは同じ画面で追加が出来るので、こちらのほうが一般的で良いと思いました。</p>
<p>構造を全て理解するにはまだ少し時間がかかりますが、すこしずつ紐解いて行きたいです。</p>
<p>デザインも一新して前よりもさらにいい感じだし、これで日本のユーザーも少しは増えてくれるかな？</p>
<p>さあＯｐｅｎＣａｒｔを使いましょう！！困ったことは相談に乗ります！一緒に解決しましょう！</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2009/02/20/opencart_/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2009/02/20/opencart_/" />
	</item>
		<item>
		<title>OpenCartのモジュール　DisplayIcons</title>
		<link>http://officesoya.net/weblog/2008/12/01/opencart_display_icon_module/</link>
		<comments>http://officesoya.net/weblog/2008/12/01/opencart_display_icon_module/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 16:14:52 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=127</guid>
		<description><![CDATA[英語の説明文が完成したのでContributionをアップしました。名前はDisplayIcons。
その名前の通り、新作リリースの場合は「New」、在庫が少ない場合は「在庫少」、在庫がない場合は「在庫無」のアイコンが出 [...]]]></description>
			<content:encoded><![CDATA[<p>英語の説明文が完成したのでContributionをアップしました。名前はDisplayIcons。<br />
その名前の通り、新作リリースの場合は「New」、在庫が少ない場合は「在庫少」、在庫がない場合は「在庫無」のアイコンが出る、というものです。新作の場合は何日まで表示するか、在庫が少ない場合のアイコンは在庫がいくつになったら表示するか設定できます。<br />
日本のショッピング事情には必須だと思うのですが、（特に在庫無しっていうの）無かったので自作しました。<br />
OpenCartを使いましょう！</p>
<p>こちらでダウンロードできます<br />
<a href="http://www.opencart.com/contribution/info/category_id/1/contribution_id/81">http://www.opencart.com/contribution/info/category_id/1/contribution_id/81</a></p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2008/12/01/opencart_display_icon_module/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2008/12/01/opencart_display_icon_module/" />
	</item>
		<item>
		<title>OpenCartのrss.phpで文字化け</title>
		<link>http://officesoya.net/weblog/2008/11/22/opencart_rss/</link>
		<comments>http://officesoya.net/weblog/2008/11/22/opencart_rss/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 15:10:28 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=123</guid>
		<description><![CDATA[OpenCartのrss.phpで日本語が文字化けする。&#38;atilde;←こんな文字がたくさん出る。
upload/rss.phpのソースコードを見てみると、48行目

foreach ($results as $result) {
$products[]=array(

'name' =&#62; htmlentities(strip_tags($result['name'])),
'url' =&#62; htmlentities($url-&#62;href('product', FALSE, array('product_id' =&#62; $result['product_id']))),
'add_date' =&#62; date(&#34;D, d M Y H:i:s T&#34;, strtotime($result['date_product_added'])),
'desc' =&#62; htmlentities(strip_tags($result['description'],'ENT_QUOTES')) .
htmlentities('&#60;br&#62;&#60;img width=&#34;100&#34; height=&#34;100&#34; src=&#34;' .
$image-&#62;resize($result['filename'], 100, 100) . '&#34;&#62;')
);
}

となっているが、ここのforeach文で文字化けしている様子。
htmlentities のデフォルト文字列は iso-8859-1なのでUTF-8に変更。

foreach ($results as $result) {
$products[]=array(

'name' =&#62; htmlentities(strip_tags($result['name']),ENT_COMPAT,&#34;utf-8&#34;),
'url' =&#62; htmlentities($url-&#62;href('product', FALSE, array('product_id' =&#62; $result['product_id'])),ENT_COMPAT,&#34;utf-8&#34;),
'add_date' =&#62; date(&#34;D, d M Y H:i:s T&#34;, strtotime($result['date_product_added'])),
'desc' =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>OpenCartのrss.phpで日本語が文字化けする。&amp;atilde;←こんな文字がたくさん出る。</p>
<p>upload/rss.phpのソースコードを見てみると、48行目</p>
<pre class="brush: php;">
foreach ($results as $result) {
$products[]=array(

'name' =&gt; htmlentities(strip_tags($result['name'])),
'url' =&gt; htmlentities($url-&gt;href('product', FALSE, array('product_id' =&gt; $result['product_id']))),
'add_date' =&gt; date(&quot;D, d M Y H:i:s T&quot;, strtotime($result['date_product_added'])),
'desc' =&gt; htmlentities(strip_tags($result['description'],'ENT_QUOTES')) .
htmlentities('&lt;br&gt;&lt;img width=&quot;100&quot; height=&quot;100&quot; src=&quot;' .
$image-&gt;resize($result['filename'], 100, 100) . '&quot;&gt;')
);
}
</pre>
<p>となっているが、ここのforeach文で文字化けしている様子。<br />
htmlentities のデフォルト文字列は iso-8859-1なのでUTF-8に変更。</p>
<pre class="brush: php;">
foreach ($results as $result) {
$products[]=array(

'name' =&gt; htmlentities(strip_tags($result['name']),ENT_COMPAT,&quot;utf-8&quot;),
'url' =&gt; htmlentities($url-&gt;href('product', FALSE, array('product_id' =&gt; $result['product_id'])),ENT_COMPAT,&quot;utf-8&quot;),
'add_date' =&gt; date(&quot;D, d M Y H:i:s T&quot;, strtotime($result['date_product_added'])),
'desc' =&gt; htmlentities(strip_tags($result['description'],'ENT_QUOTES'),ENT_COMPAT,&quot;utf-8&quot;) .
htmlentities('&lt;br&gt;&lt;img width=&quot;100&quot; height=&quot;100&quot; src=&quot;' .
$image-&gt;resize($result['filename'], 100, 100) . '&quot;&gt;'),ENT_COMPAT,&quot;utf-8&quot;
);
}
</pre>
<p>これで文字化けが解消された</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2008/11/22/opencart_rss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2008/11/22/opencart_rss/" />
	</item>
		<item>
		<title>OpenCartの日本語化</title>
		<link>http://officesoya.net/weblog/2008/11/21/opencart_japanse/</link>
		<comments>http://officesoya.net/weblog/2008/11/21/opencart_japanse/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 14:59:45 +0000</pubDate>
		<dc:creator>soya</dc:creator>
				<category><![CDATA[OpenCart]]></category>
		<category><![CDATA[日本語化]]></category>

		<guid isPermaLink="false">http://officesoya.net/weblog/?p=120</guid>
		<description><![CDATA[日本語化ファイルを制作しました。ファイルは本家http://www.opencart.com/のcontribution内にアップロードしました。ここです。
英語は基本的に苦手なので、日本人がもっとOpencartを使っ [...]]]></description>
			<content:encoded><![CDATA[<p>日本語化ファイルを制作しました。ファイルは本家http://www.opencart.com/のcontribution内にアップロードしました。<a title="コントリビューション" href="http://www.opencart.com/contribution/category/category_id/7">ここ</a>です。</p>
<p>英語は基本的に苦手なので、日本人がもっとOpencartを使ってくれるよう、日本語を見るとなんとなく安心できる人のためにアップしました。開発時間の短縮になれば、と思います。日本語化したらかえってわかりずらくなった、という方は自分で日本語を直してください。ご利用はご自身の責任でお願いします。</p>
<p>ただいま、アイコンを表示するモジュールを製作中です。完成すれば、New アイコンと在庫少ないアイコンと在庫切れアイコンが表示できるようになります。、というか、もうできているのですが、本家にアップロードするのに、インストール方法の翻訳（日本語→英語）に苦闘しています<span style="color: #c0c0c0;">（というか、できない）</span>。今週中に通訳の知り合いにお願いして翻訳してもらう予定です。</p>
]]></content:encoded>
			<wfw:commentRss>http://officesoya.net/weblog/2008/11/21/opencart_japanse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://officesoya.net/weblog/2008/11/21/opencart_japanse/" />
	</item>
	</channel>
</rss>
