<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-158226350135722575</id><updated>2024-09-06T14:15:13.027+09:00</updated><category term="php"/><category term="linux"/><category term="apache"/><category term="javascript"/><category term="ubuntu"/><category term="yui3"/><category term="C++"/><category term="HipHop for PHP"/><category term="ajax"/><category term="apt-get"/><category term="html5"/><category term="json"/><category term="mysql"/><category term="paco"/><category term="svg"/><category term="vmware"/><title type='text'>フロントが苦手なWEBエンジニアの技術メモ</title><subtitle type='html'>IT技術系での学んだことの備忘録。&#xa;気が向いたときに書きます。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-7462345999205815711</id><published>2012-04-06T01:56:00.000+09:00</published><updated>2012-04-06T02:03:10.025+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>apache2からのphpが実行できなかった時のメモ</title><content type='html'>php5.4をソースからビルドした際に何かやってしまったのか、ブラウザからphpの実行がされなくなりました。&lt;br /&gt;
phpファイルがダウンロードされる状態になったので、その時の対応メモ&lt;br /&gt;
&lt;br /&gt;
まず、&lt;a href=&quot;http://blog.shiten.info/2010/05/ubuntu-10-04-%E3%81%AE-apache2-userdir-%E3%81%A7-php-%E3%81%8C%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%84%E4%BB%B6.html&quot;&gt;こちらのページ&lt;/a&gt;を参考にしました。&lt;br /&gt;
&lt;br /&gt;
以下のファイルが見つかりませんでした。
&lt;br /&gt;
&lt;blockquote&gt;
/etc/apache2/mods-available/php5.conf &lt;/blockquote&gt;
php関連のは以下のファイルがありました。
&lt;br /&gt;
&lt;blockquote&gt;
/etc/apache2/mods-available/php5filter.conf &lt;br /&gt;
/etc/apache2/mods-available/php5filter.load &lt;/blockquote&gt;
次に、一番最初にphpとapacheをインストールした時に&lt;a href=&quot;http://perltips.twinkle.cc/linux/ubuntu/apache/php/settings&quot;&gt;参考にしたページ&lt;/a&gt;の通りに、設定したのですがダメでした。&lt;br /&gt;
&lt;br /&gt;
グーグル先生で色々調べてたら、非常に&lt;a href=&quot;http://blog.kcg.ne.jp/blog/sato_si/5488&quot;&gt;参考になるページ&lt;/a&gt;が見つかりました。&lt;br /&gt;
参考ページの通りに有効なモジュール一覧に、php関連のモジュールがありませんでした。&lt;br /&gt;
インストールされていた、php関連のモジュールを有効にしてみました。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
sudo a2enmod php5filter &lt;/blockquote&gt;
apacheを再起動し、ブラウザから確認。&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_UvR-so0zTYaui0rcZJ45nyFB1hJl0Zr5WSrkqzM3K-R561VWPOUYrw09P_s4insxuo1ovQ8ZtK0y2UgLqVlvRPExWupZ4Oxl9dQJ06mNZqACVJJBV0Yynod3E3dxjvq4sve4gv2AolE/s1600/apache_php.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_UvR-so0zTYaui0rcZJ45nyFB1hJl0Zr5WSrkqzM3K-R561VWPOUYrw09P_s4insxuo1ovQ8ZtK0y2UgLqVlvRPExWupZ4Oxl9dQJ06mNZqACVJJBV0Yynod3E3dxjvq4sve4gv2AolE/s200/apache_php.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
php5.4じゃない、、、&lt;br /&gt;
php5.4をインストールした時は、apacheに関係するconfigureオプションつけていなかったので、ビルドし直してインストールする。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
./configure --enable-mbstring \&lt;br /&gt;
--prefix=/usr/local/php \&lt;br /&gt;
--enable-mbregex \&lt;br /&gt;
--with-zlib=/usr/local/zlib \&lt;br /&gt;
--with-zlib \&lt;br /&gt;
--enable-zip \&lt;br /&gt;
--enable-ftp \&lt;br /&gt;
--enable-pcntl \&lt;br /&gt;
--enable-soap \&lt;br /&gt;
--with-mcrypt \&lt;br /&gt;
--with-gd \&lt;br /&gt;
--enable-pdo \&lt;br /&gt;
--with-pear \&lt;br /&gt;
--with-readline \&lt;br /&gt;
--with-apxs2=/usr/bin/apxs2 \&lt;br /&gt;
--with-mysql=/usr/local/mysql 
&lt;/blockquote&gt;
mysqlも利用できるようにする。&lt;br /&gt;
mysql5.6のインストール時に知った、pacoを使って管理できるようにする。&lt;br /&gt;
&lt;blockquote&gt;
make&lt;br /&gt;
sudo paco -D make install&lt;/blockquote&gt;
先程有効にしたモジュールを無効にする。
&lt;br /&gt;
&lt;blockquote&gt;
sudo a2dismod php5filter&lt;/blockquote&gt;
apacheリスタート後、再度ブラウザから確認&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJlfrhyB4pTUlFqFWKRwYSY-jm5vJOdl25IQEvcyhbnJMn27enizyT_mt9pIayHFfl-00eLKmyymkKln2kUFxchHq0GSRdQi8ekPd1RjoJ28b7H5jNWF84p9-yFq7OfPuddKqfiTVKvdM/s1600/apache_php_2.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;129&quot; width=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJlfrhyB4pTUlFqFWKRwYSY-jm5vJOdl25IQEvcyhbnJMn27enizyT_mt9pIayHFfl-00eLKmyymkKln2kUFxchHq0GSRdQi8ekPd1RjoJ28b7H5jNWF84p9-yFq7OfPuddKqfiTVKvdM/s200/apache_php_2.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
php5.4にかわったことを確認できました。&lt;br /&gt;
apt-getでインストールしたパッケージとかと混ざって変なことになってそうなので、そのうち整理しようかなと思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/7462345999205815711/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/04/apache2php.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/7462345999205815711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/7462345999205815711'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/04/apache2php.html' title='apache2からのphpが実行できなかった時のメモ'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_UvR-so0zTYaui0rcZJ45nyFB1hJl0Zr5WSrkqzM3K-R561VWPOUYrw09P_s4insxuo1ovQ8ZtK0y2UgLqVlvRPExWupZ4Oxl9dQJ06mNZqACVJJBV0Yynod3E3dxjvq4sve4gv2AolE/s72-c/apache_php.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-9004397580240928843</id><published>2012-04-05T23:40:00.001+09:00</published><updated>2012-04-06T01:56:40.685+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="paco"/><title type='text'>mysql5.6インストール</title><content type='html'>mysql5.6のインストールをしたときの備忘録。&lt;br /&gt;
mysql5.6はまだ評価版なので、ソースからビルドしてインストールしました。&lt;br /&gt;
こちらの&lt;a href=&quot;http://my-life-logs.blogspot.jp/2011/05/mysql-5512-ubuntu-1104.html&quot;&gt;記事&lt;/a&gt;を参考にさせていただきました。 &lt;br /&gt;
&lt;br /&gt;
pacoというソースからビルドして入れたものに関しても、パッケージ管理みたいにできるものがあるのを知りました。&lt;br /&gt;
参考サイトの通りの手順でpacoをインストールしてから、mysqlのインストールを開始しました。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ソースダウンロード、ビルド&lt;br /&gt;
&lt;blockquote&gt;
wget -O mysql-5.6.4-m7.tar.gz http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.4-m7.tar.gz/from/http://ftp.iij.ad.jp/pub/db/mysql/&lt;br /&gt;
&lt;br /&gt;
tar zxvf mysql-5.6.4-m7.tar.gz&lt;br /&gt;
cd mysql-5.6.4-m7/&lt;br /&gt;
cmake .&lt;br /&gt;
make&lt;br /&gt;
sudo paco -D make install
&lt;/blockquote&gt;
ここまでで、インストールは完了&lt;br /&gt;
&lt;br /&gt;
次はmysqlの設定をして起動まで&lt;br /&gt;
&lt;br /&gt;

&lt;blockquote&gt;
sudo groupadd mysql&lt;br /&gt;
sudo useradd -r -g mysql mysql&lt;br /&gt;
&lt;br /&gt;
sudo ln -s /usr/local/mysql/bin/ /usr/local/bin/&lt;br /&gt;
&lt;br /&gt;
sudo mkdir /var/log/mysql/&lt;br /&gt;
sudo touch /var/log/mysql/error.log&lt;br /&gt;
sudo touch /var/log/mysql/query.log&lt;br /&gt;
sudo touch /var/log/mysql/slow.log&lt;br /&gt;
sudo chown -R mysql. /var/log/mysql/&lt;br /&gt;
&lt;br /&gt;
sudo cp support-files/my-large.cnf /etc/my.cnf&lt;br /&gt;
export PATH=&quot;$PATH:/usr/local/mysql/bin&quot;&lt;br /&gt;

sudo ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql &lt;br /&gt;
sudo bin/mysqld_safe --user=mysql &amp;amp;&lt;br /&gt;
&lt;/blockquote&gt;
mysqlをスタートし、バージョン確認&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0xkIXZBgd8VEb36qpn5j_EbT6oVEdxDoL7OCj1TQzZpv0r1LwAKX6oDKgN1Q4xK3s8zqHvjxki-oMqYO56KG861lXASCN5A4ypeHNMsYW13nwmpr0HZKKnSgfAqqfqkSFAYVNRedIWQ/s1600/mysql5.6.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;46&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0xkIXZBgd8VEb36qpn5j_EbT6oVEdxDoL7OCj1TQzZpv0r1LwAKX6oDKgN1Q4xK3s8zqHvjxki-oMqYO56KG861lXASCN5A4ypeHNMsYW13nwmpr0HZKKnSgfAqqfqkSFAYVNRedIWQ/s200/mysql5.6.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
これでmysql5.6のインストールができたことが確認できました。&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/9004397580240928843/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/04/mysql56.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/9004397580240928843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/9004397580240928843'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/04/mysql56.html' title='mysql5.6インストール'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc0xkIXZBgd8VEb36qpn5j_EbT6oVEdxDoL7OCj1TQzZpv0r1LwAKX6oDKgN1Q4xK3s8zqHvjxki-oMqYO56KG861lXASCN5A4ypeHNMsYW13nwmpr0HZKKnSgfAqqfqkSFAYVNRedIWQ/s72-c/mysql5.6.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-3175449505038811965</id><published>2012-03-29T05:04:00.004+09:00</published><updated>2012-04-02T23:39:46.458+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apt-get"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>apt-getのpost-installationスクリプトエラー</title><content type='html'>パッケージインストール時に中途半端な状態になってしまったのか、対象のパッケージを apt-get purge や install -f, autoremoveしようとするが、エラーになってしまう状態になりました。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
isuzuki@isuzuki-VirtualBox:~$ sudo apt-get purge oracle-java7-installer &lt;br /&gt;
&lt;br /&gt;
---省略---&lt;br /&gt;
&lt;br /&gt;
oracle-java7-installer を削除しています ...&lt;br /&gt;
update-alternatives: エラー: `build&#39; は不明な引数です&lt;br /&gt;
dpkg: oracle-java7-installer の処理中にエラーが発生しました (--purge):&lt;br /&gt;
サブプロセス インストール済みの pre-removal スクリプト はエラー終了ステータス 2 を返しました&lt;br /&gt;
dpkg: クリーンアップ中にエラーが発生しました:&lt;br /&gt;
サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 10 を返しました&lt;br /&gt;
以下のパッケージの処理中にエラーが発生しました:&lt;br /&gt;
oracle-java7-installer&lt;br /&gt;
E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/blockquote&gt;
&lt;br /&gt;
パッケージに関して確認&lt;br /&gt;
&lt;blockquote&gt;
isuzuki@isuzuki-VirtualBox:~$ sudo dpkg --audit&lt;br /&gt;
以下のパッケージは最初の設定中に問題が発生したため、設定が終了していません。&lt;br /&gt;
dpkg --configure &amp;lt;パッケージ&amp;gt; か dselect で設定 (configure) メニューオプショ&lt;br /&gt;
ンを使って設定作業を再試行しなければなりません:&lt;br /&gt;
&amp;nbsp;oracle-java7-installer Sun Java(TM) Development Kit (JDK) 7
&lt;/blockquote&gt;
&lt;br /&gt;
configure実行&lt;br /&gt;
&lt;blockquote&gt;
isuzuki@isuzuki-VirtualBox:~$ sudo dpkg --configure oracle-java7-installer&lt;br /&gt;
oracle-java7-installer (7u3-0~webupd8~8) を設定しています ...&lt;br /&gt;
dpkg: oracle-java7-installer の処理中にエラーが発生しました (--configure):&lt;br /&gt;
&amp;nbsp;サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 10 を返しました&lt;br /&gt;
以下のパッケージの処理中にエラーが発生しました:&lt;br /&gt;
&amp;nbsp;oracle-java7-installer&lt;/blockquote&gt;
参考にさせていただいた、&lt;a href=&quot;http://mypace75.blog92.fc2.com/blog-entry-279.html&quot;&gt;エントリ&lt;/a&gt;に書いてあった通り、&lt;br /&gt;
/var/lib/dpkg/info の以下のファイルを削除しました。&lt;br /&gt;
&lt;blockquote&gt;
oracle-java7-installer.postinst&lt;br /&gt;
oracle-java7-installer.postrm&lt;br /&gt;
oracle-java7-installer.prerm&lt;br /&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
再度configure実行&lt;br /&gt;
&lt;blockquote&gt;
isuzuki@isuzuki-VirtualBox:~$ sudo dpkg --configure oracle-java7-installer&lt;br /&gt;
oracle-java7-installer (7u3-0~webupd8~8) を設定しています ...&lt;/blockquote&gt;
&lt;br /&gt;
試しにインストール&lt;br /&gt;
&lt;blockquote&gt;
isuzuki@isuzuki-VirtualBox:~$ sudo apt-get install oracle-java7-installer&lt;br /&gt;
パッケージリストを読み込んでいます... 完了&lt;br /&gt;
依存関係ツリーを作成しています&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
状態情報を読み取っています... 完了&lt;br /&gt;
oracle-java7-installer はすでに最新バージョンです。&lt;br /&gt;
&lt;/blockquote&gt;
正常な状態になったようです。&lt;br /&gt;
&lt;br /&gt;
より詳しくは、参考にさせていただいた&lt;a href=&quot;http://mypace75.blog92.fc2.com/blog-entry-279.html&quot;&gt;エントリ&lt;/a&gt;を&lt;br /&gt;
非常に勉強になり、再びこのような事態が起きても対応できるように覚えておこう思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/3175449505038811965/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/apt-get.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3175449505038811965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3175449505038811965'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/apt-get.html' title='apt-getのpost-installationスクリプトエラー'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-8985047605070454607</id><published>2012-03-25T06:51:00.006+09:00</published><updated>2012-03-25T08:26:20.052+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHPでscanf</title><content type='html'>PHP extension の勉強をしていて、C言語を久々に触っていた時に、PHP で scanf みたいなのって書いたことないなと思ったので、調べて書いてみました。&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://d.hatena.ne.jp/elf/20060807/1154917946&quot;&gt;こちらのエントリ&lt;/a&gt;に書いてあったことをそのまま試してみました。&lt;br /&gt;&lt;br /&gt;・scanf のサンプル&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;echo &#39;文字列を入力してください。&#39; .&quot;\n&quot;;&lt;br /&gt;fscanf(STDIN, &#39;%s&#39;, $str);&lt;br /&gt;var_dump($str);&lt;br /&gt;&lt;br /&gt;echo &#39;文字列を入力してください。&#39; .&quot;\n&quot;;&lt;br /&gt;$stdin = fopen(&#39;php://stdin&#39;, &#39;r&#39;);&lt;br /&gt;$str = trim(fgets($stdin));&lt;br /&gt;fclose($stdin);&lt;br /&gt;var_dump($str);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;・実行結果&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlGgCOnCwvbtFndE8fkNgIljyKTqJt48og-cPaVrutTd-SvboJit3fcSyg5D9tzJ95MQffQNumBq4vwoUnHLm5USBS-jbjCVb3P0Y4v2qmpfMp8pFfWmwLLm96UoDlM609usJf8wcTyAY/s1600/scanf.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 58px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlGgCOnCwvbtFndE8fkNgIljyKTqJt48og-cPaVrutTd-SvboJit3fcSyg5D9tzJ95MQffQNumBq4vwoUnHLm5USBS-jbjCVb3P0Y4v2qmpfMp8pFfWmwLLm96UoDlM609usJf8wcTyAY/s200/scanf.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5723586553926732498&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;どちらも求める結果になりました。&lt;br /&gt;違いに関しては、僕が参考にしたエントリを見ていただければと思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/8985047605070454607/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/phpscanf.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/8985047605070454607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/8985047605070454607'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/phpscanf.html' title='PHPでscanf'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlGgCOnCwvbtFndE8fkNgIljyKTqJt48og-cPaVrutTd-SvboJit3fcSyg5D9tzJ95MQffQNumBq4vwoUnHLm5USBS-jbjCVb3P0Y4v2qmpfMp8pFfWmwLLm96UoDlM609usJf8wcTyAY/s72-c/scanf.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-6759393532195303423</id><published>2012-03-20T01:00:00.001+09:00</published><updated>2012-03-20T01:00:00.326+09:00</updated><title type='text'>PHP5.4、配列文法</title><content type='html'>PHP5.4 から配列を簡単に書けるようになりました。&lt;br /&gt;&lt;br /&gt;・今までの配列定義&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$arr = array(&#39;a&#39; =&gt; &#39;test1&#39;,&lt;br /&gt;             &#39;b&#39; =&gt; &#39;test2&#39;,&lt;br /&gt;             &#39;c&#39; =&gt; &#39;test3&#39;,&lt;br /&gt;        );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;・新たな配列定義&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$arr = [&#39;a&#39; =&gt; &#39;test1&#39;,&lt;br /&gt;        &#39;b&#39; =&gt; &#39;test2&#39;,&lt;br /&gt;        &#39;c&#39; =&gt; &#39;test3&#39;,&lt;br /&gt;       ];&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;配列定義をループさせてみましたが、特にパフォーマンスに差はありませんでした。&lt;br /&gt;今まで使用してきた言語によると思いますが、PHP5.4以前のころから利用している人は、新しい書き方はあまりしないかもですね。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/6759393532195303423/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/php54.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6759393532195303423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6759393532195303423'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/php54.html' title='PHP5.4、配列文法'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-6926777425715754925</id><published>2012-03-19T01:52:00.014+09:00</published><updated>2012-03-19T02:42:07.156+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHP5.4インストール、Traitsの利用</title><content type='html'>PHP5.4が安定版としてリリースされたので、インストールしてみました。&lt;br /&gt;インストール手順は&lt;a href=&quot;http://ict-start.com/blog/?p=265&quot;&gt;こちらの記事&lt;/a&gt;を参考にしました。&lt;br /&gt;&lt;br /&gt;・ソース取得&lt;br /&gt;wget http://www.php.net/get/php-5.4.0.tar.gz/from/jp.php.net/mirror -O php-5.4.0.tar.gz&lt;br /&gt;&lt;br /&gt;・tarファイル展開&lt;br /&gt;tar xvf php-5.4.0.tar&lt;br /&gt;&lt;br /&gt;・コンパイルオプション設定&lt;br /&gt;cd php-5.4.0&lt;br /&gt;./configure --enable-mbstring \&lt;br /&gt;--prefix=/usr/local/php \&lt;br /&gt;--enable-mbregex \&lt;br /&gt;--with-zlib=/usr/local/zlib \&lt;br /&gt;--with-zlib \&lt;br /&gt;--enable-zip \&lt;br /&gt;--enable-ftp \&lt;br /&gt;--enable-pcntl \&lt;br /&gt;--enable-soap \&lt;br /&gt;--with-mcrypt \&lt;br /&gt;--with-gd \&lt;br /&gt;--enable-pdo \&lt;br /&gt;--with-pear \&lt;br /&gt;--with-readline \&lt;br /&gt;&lt;br /&gt;・make、インストール&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;br /&gt;&lt;br /&gt;・確認&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgipIIiF4N4f9S9P1wJjLEz1n6CCqGzblB8jBYPPwL0PTgpvvEU9RXwiVKOpkD3q4gmNpKWNdjxRqwwubZFwW9uD0_Fu1aQyIt1hQqRIzw41KgUgB9gCyVO9K7Dkhulkk2s1qk9EDt0pPw/s1600/php5.4.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 35px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgipIIiF4N4f9S9P1wJjLEz1n6CCqGzblB8jBYPPwL0PTgpvvEU9RXwiVKOpkD3q4gmNpKWNdjxRqwwubZFwW9uD0_Fu1aQyIt1hQqRIzw41KgUgB9gCyVO9K7Dkhulkk2s1qk9EDt0pPw/s200/php5.4.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5721285810849726546&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;これでPHP5.4のインストールが完了しました。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;新機能の Traits を試してみました。&lt;br /&gt;Traits はソースの再利用に有効になるかもしれません。詳しくは&lt;a href=&quot;http://www.php.net/manual/ja/language.oop5.traits.php&quot;&gt;マニュアル&lt;/a&gt; に書いています。&lt;br /&gt;&lt;br /&gt;Traits を利用したシングルトン&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;trait TraitSingleton {&lt;br /&gt;    private static $_instance;&lt;br /&gt;&lt;br /&gt;    private function __construct() {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static function getInstance() {&lt;br /&gt;        if (isset(self::$_instance) === false) {&lt;br /&gt;            self::$_instance = new static;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return self::$_instance;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;シングルトン Traits 利用&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;require_once(&#39;/home/isuzuki/dev/php/php5.4/TraitSingleton.php&#39;);&lt;br /&gt;&lt;br /&gt;abstract class Base {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class TraitSample1 extends Base {&lt;br /&gt;    use TraitSingleton;&lt;br /&gt;&lt;br /&gt;    private function __construct() {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function echoClass() {&lt;br /&gt;        echo __CLASS__ .&quot;\n&quot;;&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class TraitSample2 extends Base {&lt;br /&gt;    use TraitSingleton;&lt;br /&gt;&lt;br /&gt;    private function __construct() {&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public function echoClass() {&lt;br /&gt;        echo __CLASS__ .&quot;\n&quot;;&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$obj1 = TraitSample1::getInstance();&lt;br /&gt;$obj1-&gt;echoClass();&lt;br /&gt;$obj2 = TraitSample2::getInstance();&lt;br /&gt;$obj2-&gt;echoClass();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;実行結果&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEZH5P_U_m8oahgE14IBo9Zg9eQCBHCrQ4xESLPrIRhcRRPH3NXMZRkGv2g06qj4qkwkwV7UI_L1znUDWrITEL5l6crXNOKgekDzlbXYvppGUPU0u0LCTZyZ7-0iSPNV6QABnnDcC8fHw/s1600/Trait.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 34px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEZH5P_U_m8oahgE14IBo9Zg9eQCBHCrQ4xESLPrIRhcRRPH3NXMZRkGv2g06qj4qkwkwV7UI_L1znUDWrITEL5l6crXNOKgekDzlbXYvppGUPU0u0LCTZyZ7-0iSPNV6QABnnDcC8fHw/s200/Trait.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5721291490535054514&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;これで、Traitsが無事利用できていることがわかりました。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/6926777425715754925/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/php54trait.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6926777425715754925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6926777425715754925'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/php54trait.html' title='PHP5.4インストール、Traitsの利用'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgipIIiF4N4f9S9P1wJjLEz1n6CCqGzblB8jBYPPwL0PTgpvvEU9RXwiVKOpkD3q4gmNpKWNdjxRqwwubZFwW9uD0_Fu1aQyIt1hQqRIzw41KgUgB9gCyVO9K7Dkhulkk2s1qk9EDt0pPw/s72-c/php5.4.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-6519547300845688717</id><published>2012-03-12T01:52:00.021+09:00</published><updated>2012-03-12T02:49:45.124+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="HipHop for PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>HipHop for PHP インストール</title><content type='html'>FacebookのHipHop for PHPをUbuntu 11.10にインストールしてみました。&lt;br /&gt;手順は、Facebookが公開している手順(&lt;a href=&quot;https://github.com/facebook/hiphop-php/wiki/Building-and-Installing-on-Ubuntu-11.10&quot;&gt;Building and Installing on Ubuntu 11.10&lt;/a&gt;)どおりに行えば問題ないです。&lt;br /&gt;&lt;br /&gt;何点かインストール中に躓いたところで、OSを32bitにしていたので、cmakeの時点でwarningが出ました。&lt;br /&gt;32bitでのcmake結果です。&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8FpA3qNkmJUMjbfnlfq2zEizDTfYLLSSrFEAwYw2Met0jF6fdVeHpiOgXuGm1QS_gWu22peSJ-yNbqfCBih8KOM-4mHrkFVRLKPNhm-crrbdDD8sZYUkX_wU75l5ObdVPL3vxs_CQqd0/s1600/hiphop_32bit.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 114px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8FpA3qNkmJUMjbfnlfq2zEizDTfYLLSSrFEAwYw2Met0jF6fdVeHpiOgXuGm1QS_gWu22peSJ-yNbqfCBih8KOM-4mHrkFVRLKPNhm-crrbdDD8sZYUkX_wU75l5ObdVPL3vxs_CQqd0/s200/hiphop_32bit.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5718688537509436114&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;32bitでも動かせるようですが、OSを64bitにして再トライしました。&lt;br /&gt;&lt;br /&gt;同様の手順で、cmakeしたところ、特に何もメッセージも出ないので、続けてmakeし、実行しました。&lt;br /&gt;ソースの修正を見逃していて、segmentation faultで落ちました。&lt;br /&gt;&lt;br /&gt;こちらも、手順に書いてあるように、&lt;br /&gt;lib/ssluse.c を&lt;a href=&quot;https://github.com/bagder/curl/commit/26b487a5d6ed9da5bc8e4a134a88d3125884b852&quot;&gt;git hub&lt;/a&gt;のとおりに修正、&lt;br /&gt;src/runtime/ext/extension.cpp も同様に&lt;a href=&quot;https://github.com/h4ck3rm1k3/hiphop-php/commit/0628599b4b03dff6b33bc2ea31de09f236ea6452#diff-5&quot;&gt;git hub&lt;/a&gt;のとおりに修正。&lt;br /&gt;&lt;br /&gt;make後、無事実行できることを確認しました。&lt;br /&gt;&lt;br /&gt;サンプルプログラムを、HipHopで実行してみました。&lt;br /&gt;・PHPソース&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;echo &#39;HipHop for PHP&#39; .&quot;\n&quot;;&lt;br /&gt;echo &#39;Hello World&#39; . &quot;\n&quot;;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;実行結果&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDhsrtdXRyRO6OxQ8FqrTVrdJt_-aVnJ7StxO5BMN_8Flwc4peR5_IkAoclz_Vd8_lnFDM4EcwitbmzY0gxjGbWQiOxlDXw6pFmlKJvuqsc82so9H5tpPYj6uknMnYE0QS-xgv0b1x2Cg/s1600/hiphop_exec.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 34px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDhsrtdXRyRO6OxQ8FqrTVrdJt_-aVnJ7StxO5BMN_8Flwc4peR5_IkAoclz_Vd8_lnFDM4EcwitbmzY0gxjGbWQiOxlDXw6pFmlKJvuqsc82so9H5tpPYj6uknMnYE0QS-xgv0b1x2Cg/s200/hiphop_exec.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5718692669111925650&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;実行後、指定したディレクトリ以下には実行ファイルや、C++に変換されたソースなどがありました。&lt;br /&gt;実行ファイルの結果&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2r0m4d8tVRifG5V7Dw63dXENL3m3pcIFtI-Zrcb62Z3Yo7xjP0mA5uGUbTxzokUWCk1Ws8098dsq9J5uJ3jUSCerQ9WmH8KNKTLCWOcg0lVgzb1ltIM7qZ-bMISV7j7FifwJ9wBYuPLU/s1600/hiphop_hello.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 26px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2r0m4d8tVRifG5V7Dw63dXENL3m3pcIFtI-Zrcb62Z3Yo7xjP0mA5uGUbTxzokUWCk1Ws8098dsq9J5uJ3jUSCerQ9WmH8KNKTLCWOcg0lVgzb1ltIM7qZ-bMISV7j7FifwJ9wBYuPLU/s200/hiphop_hello.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5718694178751306914&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;・C++ソース&lt;br /&gt;/tmp/hphp/php/home/isuzuki/dev/php/hello.cpp&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;br /&gt;#include &amp;lt;runtime/base/hphp.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/literal_strings_remap.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/scalar_arrays_remap.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/scalar_integers_remap.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/global_variables.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/cpputil.h&amp;gt;&lt;br /&gt;#include &amp;lt;php//home/isuzuki/dev/php/hello.fws.h&amp;gt;&lt;br /&gt;#include &amp;lt;php//home/isuzuki/dev/php/hello.h&amp;gt;&lt;br /&gt;&lt;br /&gt;// Dependencies&lt;br /&gt;#include &amp;lt;runtime/ext/ext.h&amp;gt;&lt;br /&gt;namespace hphp_impl_starter {}&lt;br /&gt;&lt;br /&gt;namespace HPHP {&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;&lt;br /&gt;/* preface starts */&lt;br /&gt;extern CallInfo ci_;&lt;br /&gt;/* preface finishes */&lt;br /&gt;Variant pm_php$$home$isuzuki$dev$php$hello_php(bool incOnce, LVariableTable*&lt;br /&gt; variables, Globals *globals) {&lt;br /&gt;  PSEUDOMAIN_INJECTION(run_init::/home/isuzuki/dev/php/hello.php, pm_php$$ho&lt;br /&gt;me$isuzuki$dev$php$hello_php);&lt;br /&gt;  LVariableTable *gVariables ATTRIBUTE_UNUSED = (LVariableTable *)g;&lt;br /&gt;  echo(NAMSTR(s_ssedffcbbc, &amp;quot;HipHop for PHP\n&amp;quot;));&lt;br /&gt;  echo(NAMSTR(s_ssc9bf8a1a, &amp;quot;Hello World\n&amp;quot;));&lt;br /&gt;  return true;&lt;br /&gt;}&lt;br /&gt;namespace hphp_impl_splitter {}&lt;br /&gt;&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/tmp/hphp/php/home/isuzuki/dev/php/hello.fws.h&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;br /&gt;&lt;br /&gt;#ifndef __GENERATED_php__home_isuzuki_dev_php_hello_fws_h6d9aa4dd__&lt;br /&gt;#define __GENERATED_php__home_isuzuki_dev_php_hello_fws_h6d9aa4dd__&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace HPHP {&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;&lt;br /&gt;// 1. Static Strings&lt;br /&gt;extern StaticString s_ssc9bf8a1a;&lt;br /&gt;extern StaticString s_ssedffcbbc;&lt;br /&gt;&lt;br /&gt;// 2. Static Arrays&lt;br /&gt;&lt;br /&gt;// 3. Static Variants&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#endif // __GENERATED_php__home_isuzuki_dev_php_hello_fws_h6d9aa4dd__&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;/tmp/hphp/php/home/isuzuki/dev/php/hello.h&lt;br /&gt;&lt;pre class=&quot;brush: cpp&quot;&gt;&lt;br /&gt;&lt;br /&gt;#ifndef __GENERATED_php__home_isuzuki_dev_php_hello_h344dcfd5__&lt;br /&gt;#define __GENERATED_php__home_isuzuki_dev_php_hello_h344dcfd5__&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Declarations&lt;br /&gt;&lt;br /&gt;namespace HPHP {&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;&lt;br /&gt;// Includes and Functions&lt;br /&gt;Variant pm_php$$home$isuzuki$dev$php$hello_php(bool incOnce, LVariableTable*&lt;br /&gt; variables, Globals *globals);&lt;br /&gt;&lt;br /&gt;// Constants&lt;br /&gt;&lt;br /&gt;////////////////////////////////////////////////////////////////////////////&lt;br /&gt;///&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endif // __GENERATED_php__home_isuzuki_dev_php_hello_h344dcfd5__&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;このようなソースができていました。&lt;br /&gt;これで、インストールは完了したので、今後色々と使ってみようと思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/6519547300845688717/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/hiphop-for-php.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6519547300845688717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6519547300845688717'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/hiphop-for-php.html' title='HipHop for PHP インストール'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8FpA3qNkmJUMjbfnlfq2zEizDTfYLLSSrFEAwYw2Met0jF6fdVeHpiOgXuGm1QS_gWu22peSJ-yNbqfCBih8KOM-4mHrkFVRLKPNhm-crrbdDD8sZYUkX_wU75l5ObdVPL3vxs_CQqd0/s72-c/hiphop_32bit.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-6415245000057043496</id><published>2012-03-01T23:15:00.006+09:00</published><updated>2012-03-01T23:45:48.472+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>ファイルダウンロード</title><content type='html'>PHPでcsvファイルをダウンロードするサンプルプログラムを作成してみました。&lt;br /&gt;&lt;br /&gt;最初のソースはファイルを作成して、ダウンロードさせるパターンです。&lt;br /&gt;ファイル内容が、膨大な量になる時はこちらの方法がいいのかと思います。&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$file = &#39;/tmp/file.csv.&#39; .getmypid();&lt;br /&gt;$fp = fopen($file, &#39;w&#39;);&lt;br /&gt;if ($fp === false) {&lt;br /&gt;    error_log(&#39;file open error&#39;);&lt;br /&gt;    exit(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$header = array(&#39;num&#39;,&lt;br /&gt;                &#39;line&#39;,&lt;br /&gt;                &#39;data&#39;,&lt;br /&gt;        );&lt;br /&gt;fputcsv($fp, $header);&lt;br /&gt;&lt;br /&gt;for($i=1;$i&lt;=100;$i++) {&lt;br /&gt;    $line = array($i,&lt;br /&gt;                  &#39;line&#39; . $i,&lt;br /&gt;                  &#39;data&#39; . $i,&lt;br /&gt;            );&lt;br /&gt;    fputcsv($fp, $line);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;fclose($fp);&lt;br /&gt;&lt;br /&gt;header(&#39;Content-Type: application/octet-stream&#39;);&lt;br /&gt;header(&#39;Content-Disposition: attachment; filename=&quot;download.csv&quot;&#39;);&lt;br /&gt;header(&#39;Content-Length: &#39;.filesize($file));&lt;br /&gt;readfile($file);&lt;br /&gt;&lt;br /&gt;@unlink($file);&lt;br /&gt;exit(0);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;二つ目のソースは出力バッファを利用したものになります。&lt;br /&gt;自分はファイルの内容問わず、ファイルを作成する方法でやっていたのですが、内容が大した量ではないときはこちらの方法の方が効率良いかと思います。&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$fp = fopen(&#39;php://output&#39;, &#39;w&#39;);&lt;br /&gt;if ($fp === false) {&lt;br /&gt;    error_log(&#39;file open error&#39;);&lt;br /&gt;    exit(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ob_start();&lt;br /&gt;$header = array(&#39;num&#39;,&lt;br /&gt;                &#39;line&#39;,&lt;br /&gt;                &#39;data&#39;,&lt;br /&gt;        );&lt;br /&gt;fputcsv($fp, $header);&lt;br /&gt;&lt;br /&gt;for($i=1;$i&lt;=100;$i++) {&lt;br /&gt;    $line = array($i,&lt;br /&gt;                  &#39;line&#39; . $i,&lt;br /&gt;                  &#39;data&#39; . $i,&lt;br /&gt;            );&lt;br /&gt;    fputcsv($fp, $line);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$str = ob_get_contents();&lt;br /&gt;fclose($fp);&lt;br /&gt;ob_end_clean();&lt;br /&gt;&lt;br /&gt;header(&#39;Content-Type: application/octet-stream&#39;);&lt;br /&gt;header(&#39;Content-Disposition: attachment; filename=&quot;download.csv&quot;&#39;);&lt;br /&gt;header(&#39;Content-Length: &#39;.strlen($str));&lt;br /&gt;echo $str;&lt;br /&gt;&lt;br /&gt;exit(0);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;入出力ストリームへのアクセスとか全然知らなかったので、非常に勉強になりました。&lt;br /&gt;&lt;a href=&quot;http://nc.php.net/manual/ja/wrappers.php.php&quot;&gt;PHPマニュアル&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/6415245000057043496/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6415245000057043496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6415245000057043496'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/03/blog-post.html' title='ファイルダウンロード'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-5518233811505628716</id><published>2012-01-27T00:05:00.010+09:00</published><updated>2012-01-27T00:33:20.681+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHP json_decode ではまったこと</title><content type='html'>配列をjsonに変換し、POSTした画面先で再度配列に直す処理を書いていたときにはまったこと。&lt;br /&gt;&lt;br /&gt;json_decodeの第二引数を「true」にして連想配列にすれば良かったのですが、見逃していて自力で配列にキャストした時に、よくわからないことが起こりました。&lt;br /&gt;&lt;br /&gt;自力で配列へのキャスト&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$arr = array(1  =&amp;gt; &#39;hoge&#39;,&lt;br /&gt;            &#39;a&#39; =&amp;gt; &#39;fuga&#39;,&lt;br /&gt;             2  =&amp;gt; &#39;piyo&#39;,&lt;br /&gt;            &#39;b&#39; =&amp;gt; 1234,&lt;br /&gt;        );&lt;br /&gt;&lt;br /&gt;$json = json_encode($arr);&lt;br /&gt;var_dump($json);&lt;br /&gt;&lt;br /&gt;$json_arr = (array)json_decode($json);&lt;br /&gt;var_dump($json_arr);&lt;br /&gt;&lt;br /&gt;foreach ($json_arr as $k =&amp;gt; $v) {&lt;br /&gt;var_dump($json_arr[$k]);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;このコードの実行結果は以下の様になりました。&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis8VcyS4ImtmDi_wTWUZ852yB-zAE_fy1Ll7lgXwvh8Xj9DtN74tz-VX_JZI-EphcXKfYIRKERc7ptSSaZ8s6GQ_fh1SmzoPfazF5fsD9PLG4UQL6Lrcwv_Jt8ANReSmajiJVfCpZrZ2Y/s1600/json_decode1.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 116px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis8VcyS4ImtmDi_wTWUZ852yB-zAE_fy1Ll7lgXwvh8Xj9DtN74tz-VX_JZI-EphcXKfYIRKERc7ptSSaZ8s6GQ_fh1SmzoPfazF5fsD9PLG4UQL6Lrcwv_Jt8ANReSmajiJVfCpZrZ2Y/s200/json_decode1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5701961095720830674&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;エラーが出るのでキーに「&quot;1&quot;」の文字列が入ったのかなとか思ったのですが、結局そのキーを指定しても、ダメでした。&lt;br /&gt;結局なぜダメなのかはわからずですが、json_decodeの第二引数を「true」にした場合は、問題なかったのでそちらでやるようにしました。&lt;br /&gt;原因知りたいですが、未だわからずです。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;第二引数に「true」を師弟&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;?php&lt;br /&gt;$arr = array(1   =&amp;gt; &#39;hoge&#39;,&lt;br /&gt;             &#39;a&#39; =&amp;gt; &#39;fuga&#39;,&lt;br /&gt;             2   =&amp;gt; &#39;piyo&#39;,&lt;br /&gt;             &#39;b&#39; =&amp;gt; 1234,&lt;br /&gt;         );&lt;br /&gt;&lt;br /&gt;$json = json_encode($arr);&lt;br /&gt;var_dump($json);&lt;br /&gt;&lt;br /&gt;$json_arr = json_decode($json, true);&lt;br /&gt;var_dump($json_arr);&lt;br /&gt;&lt;br /&gt;foreach ($json_arr as $k =&amp;gt; $v) {&lt;br /&gt; var_dump($json_arr[$k]);&lt;br /&gt; var_dump($json_arr[(string)$k]);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;このコードの実行結果は以下の様になりました。&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8GG-ozABmB2sg36muADAr3R-lLKYSeCSyzRvCFTaq5y43_KQYHKOeaRfjy9-v439sUHaepTH4tB8cs3fESXq3rHnpL9aWl1BZiTI_H12xxFjk2TpmKzZxV_hC818sKrnK-YzjK8uRxAo/s1600/json_decode2.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 136px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8GG-ozABmB2sg36muADAr3R-lLKYSeCSyzRvCFTaq5y43_KQYHKOeaRfjy9-v439sUHaepTH4tB8cs3fESXq3rHnpL9aWl1BZiTI_H12xxFjk2TpmKzZxV_hC818sKrnK-YzjK8uRxAo/s200/json_decode2.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5701962246740303554&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;jsonから配列に変換する時は、json_decodeを利用するとキーが数字の場合は、int型のキー配列に変換してくれるようです。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/5518233811505628716/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/01/php-jsondecode.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/5518233811505628716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/5518233811505628716'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/01/php-jsondecode.html' title='PHP json_decode ではまったこと'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis8VcyS4ImtmDi_wTWUZ852yB-zAE_fy1Ll7lgXwvh8Xj9DtN74tz-VX_JZI-EphcXKfYIRKERc7ptSSaZ8s6GQ_fh1SmzoPfazF5fsD9PLG4UQL6Lrcwv_Jt8ANReSmajiJVfCpZrZ2Y/s72-c/json_decode1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-9014583356384661022</id><published>2012-01-10T06:17:00.010+09:00</published><updated>2012-01-10T06:39:57.393+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="svg"/><title type='text'>SVGの簡単なサンプル</title><content type='html'>SVGというものを最近知ったので、サンプルを書いてみた。&lt;br /&gt;サンプルと言っても、下記ページを読んで、そのまま書いて見ただけです。&lt;br /&gt;&lt;a href=&quot;http://ascii.jp/elem/000/000/585/585608/&quot;&gt;ASCII.jp &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;サンプルHTML&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;meta charset=&quot;UTF-8&quot; /&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;SVGサンプル&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;table border=&quot;1&quot;&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;四角&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;角丸四角&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;正円&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;楕円&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;直線&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;連続直線&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;多角形&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;ベジエ曲線&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;th&amp;gt;&amp;lt;div&amp;gt;&amp;lt;p&amp;gt;JSで記述&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;rect x=&quot;1&quot; y=&quot;1&quot; fill=&quot;blue&quot; stroke=&quot;red&quot; width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;rect x=&quot;1&quot; y=&quot;1&quot; fill=&quot;blue&quot; stroke=&quot;red&quot; width=&quot;100&quot; height=&quot;100&quot; ry=&quot;20&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;circle cx=&quot;50&quot; cy=&quot;50&quot; r=&quot;50&quot; fill=&quot;blue&quot; stroke=&quot;red&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;ellipse cx=&quot;50&quot; cy=&quot;50&quot; rx=&quot;50&quot; ry=&quot;30&quot; fill=&quot;blue&quot; stroke=&quot;red&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;line x1=&quot;1&quot; y1=&quot;1&quot; x2=&quot;100&quot; y2=&quot;100&quot; stroke=&quot;blue&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;polyline points=&quot;1,1 50,100 100,1&quot; fill=&quot;none&quot; stroke=&quot;blue&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;polygon points=&quot;1,1 50,100 100,1&quot; fill=&quot;none&quot; stroke=&quot;blue&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;svg&amp;gt;&lt;br /&gt;&amp;lt;path d=&quot;M 1,1 C 33,100,66,20,100,30&quot; fill=&quot;none&quot; stroke=&quot;blue&quot;&amp;gt;&lt;br /&gt;&amp;lt;/svg&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td width=&quot;100&quot; height=&quot;100&quot;&amp;gt;&lt;br /&gt;&amp;lt;form&amp;gt;&lt;br /&gt;&amp;lt;input type=&quot;button&quot; value=&quot;直線を描く&quot; onclick=&quot;drawLine()&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;script&amp;gt;&amp;lt;!--&lt;br /&gt;function drawLine() {&lt;br /&gt;document.getElementById(&#39;mySVG&#39;).innerHTML = &#39;&amp;lt;svg&amp;gt;&amp;lt;line x1=&quot;1&quot; y1=&quot;100&quot; x2=&quot;100&quot; y2=&quot;1&quot; stroke=&quot;blue&quot;&amp;gt;&#39;;&lt;br /&gt;}&lt;br /&gt;--&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;div id=&quot;mySVG&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK_es3KFQRoxwuT8_t4iR53BhgacOgFEz_08HkCJD9Zt4-aOI88-Ux6pi7C5YoHIQdCSylIyK7V8qFnWUc_81AaZ7oWuO0pXVGQM3XfUaiAunAcCjObAXZtRRIm9Gv52jLqtiCyZDsn8U/s1600/svg1.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 70px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK_es3KFQRoxwuT8_t4iR53BhgacOgFEz_08HkCJD9Zt4-aOI88-Ux6pi7C5YoHIQdCSylIyK7V8qFnWUc_81AaZ7oWuO0pXVGQM3XfUaiAunAcCjObAXZtRRIm9Gv52jLqtiCyZDsn8U/s200/svg1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5695748808020360786&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;連続曲線の時に、fill属性をnoneにしないと、黒で内部が塗りつぶされます。&lt;br /&gt;ブラウザは特定以上のバージョンじゃないと、上手く表示されないようです。&lt;br /&gt;&lt;br /&gt;これを使えば、僕の用にあまりhtmlとか詳しくなくてもちょっとした図形を書くことができそうです。&lt;br /&gt;以前と比べて導入しやすくなったようです。このような物もあるんだなと思いました。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/9014583356384661022/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2012/01/svg.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/9014583356384661022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/9014583356384661022'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2012/01/svg.html' title='SVGの簡単なサンプル'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK_es3KFQRoxwuT8_t4iR53BhgacOgFEz_08HkCJD9Zt4-aOI88-Ux6pi7C5YoHIQdCSylIyK7V8qFnWUc_81AaZ7oWuO0pXVGQM3XfUaiAunAcCjObAXZtRRIm9Gv52jLqtiCyZDsn8U/s72-c/svg1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-159109907899602294</id><published>2011-11-29T02:22:00.007+09:00</published><updated>2011-11-29T02:38:46.412+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="yui3"/><title type='text'>YUI3 で非同期通信</title><content type='html'>YUI3 を使って非同期通信するサンプルを作成。&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;javascript&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: javascript&quot;&gt;YUI().use(&#39;io&#39;, function(Y) {&lt;br /&gt;  Y.one(&#39;#getItem&#39;).on(&#39;click&#39;, function(e) {&lt;br /&gt;      e.preventDefault();&lt;br /&gt;    &lt;br /&gt;      var url = &#39;json.php&#39;;&lt;br /&gt;      Y.io(url, {&lt;br /&gt;          method : &#39;POST&#39;,&lt;br /&gt;          on : {&lt;br /&gt;              success : function(id, o) {&lt;br /&gt;                  console.log(o.responseText);&lt;br /&gt;              },&lt;br /&gt;              failure : function() {&lt;br /&gt;                  alert(&#39;io Error&#39;);&lt;br /&gt;              }&lt;br /&gt;          }&lt;br /&gt;      });&lt;br /&gt;  });&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;php&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;YUI3.0サンプル&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script src=&quot;http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script src=&quot;/sample.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body class=&quot;yui3-skin-sam&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;a href=&quot;&quot; id=&quot;getItem&quot;&amp;gt;getItem&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;これで、geItem リンクをクリックすると非同期通信が起こります。&lt;br /&gt;今回は簡単な json を表示する PHP に対して通信しています。&lt;br /&gt;取得した json を console に出力しています。&lt;br /&gt;&lt;br /&gt;リクエスト前&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_bM8X3lWdDjRMK8HL2Q4fXh5PP4xB7MiLWiqAOFnk6hW6QrUDPxlEMrKaInA2Kxz13s7e0xvxX4NxDR6vnaG1KMui2VYcRbE7jIW01TclmHNB-U5fMbgCLc8GELxChSFr_lcGklJr_E/s1600/io1.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 170px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_bM8X3lWdDjRMK8HL2Q4fXh5PP4xB7MiLWiqAOFnk6hW6QrUDPxlEMrKaInA2Kxz13s7e0xvxX4NxDR6vnaG1KMui2VYcRbE7jIW01TclmHNB-U5fMbgCLc8GELxChSFr_lcGklJr_E/s200/io1.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5680101714281819522&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;リクエスト後&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2oC0Blc_qePG-WVO-5JjrgQZkiIbYSC16hmD2OL79Eoz2xTOsXWw8pfbQP2o7Oo5kNbNStBZgxZhucraBvGhEu8y-DB1cLvKf9wfq62PnrQlzmPuIU8j_wBUfXkuKRmSjegRZBpv0oWc/s1600/io2.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 168px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2oC0Blc_qePG-WVO-5JjrgQZkiIbYSC16hmD2OL79Eoz2xTOsXWw8pfbQP2o7Oo5kNbNStBZgxZhucraBvGhEu8y-DB1cLvKf9wfq62PnrQlzmPuIU8j_wBUfXkuKRmSjegRZBpv0oWc/s200/io2.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5680101879939004994&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://yuilibrary.com/yui/docs/io/&quot;&gt;yuiドキュメント&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;これで、ページ遷移せずに API からデータを取得して表示などができます。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/159109907899602294/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/yui3.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/159109907899602294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/159109907899602294'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/yui3.html' title='YUI3 で非同期通信'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0_bM8X3lWdDjRMK8HL2Q4fXh5PP4xB7MiLWiqAOFnk6hW6QrUDPxlEMrKaInA2Kxz13s7e0xvxX4NxDR6vnaG1KMui2VYcRbE7jIW01TclmHNB-U5fMbgCLc8GELxChSFr_lcGklJr_E/s72-c/io1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-5421907124050860638</id><published>2011-11-21T03:24:00.009+09:00</published><updated>2011-11-21T03:42:42.925+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="yui3"/><title type='text'>YUI3 でpanel表示</title><content type='html'>YUI3 を使って panel を表示するサンプルを作成。&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;javascript&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: javascript&quot;&gt;&lt;br /&gt;YUI().use(&#39;panel&#39;, function(Y) {&lt;br /&gt;    var panel = new Y.Panel({&lt;br /&gt;        srcNode  : &#39;#sPanel&#39;,&lt;br /&gt;        centered : true,&lt;br /&gt;        render   : true,&lt;br /&gt;        visible  : false,&lt;br /&gt;        modal    : true,&lt;br /&gt;        buttons  : []&lt;br /&gt;    }); &lt;br /&gt;    &lt;br /&gt;    Y.one(&#39;#sPanelOpen&#39;).on(&#39;click&#39;, function(e) {&lt;br /&gt;        e.preventDefault();&lt;br /&gt;        panel.show();&lt;br /&gt;    }); &lt;br /&gt;    &lt;br /&gt;    Y.one(&#39;#sPanelClose&#39;).on(&#39;click&#39;, function(e) {&lt;br /&gt;        e.preventDefault();&lt;br /&gt;        panel.hide();&lt;br /&gt;    }); &lt;br /&gt;}); &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;php&lt;/span&gt;&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;YUI3.0サンプル&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;quot;http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script src=&amp;quot;/sample.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body class=&amp;quot;yui3-skin-sam&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;&amp;quot; id=&amp;quot;sPanelOpen&amp;quot;&amp;gt;open&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&amp;quot;sPanel&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;strong&amp;gt;サンプルパネル&amp;lt;/strong&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;&amp;lt;a href=&amp;quot;&amp;quot; id=&amp;quot;sPanelClose&amp;quot;&amp;gt;close&amp;lt;/a&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;これで、open リンクをクリックすると panel が表示されます。&lt;br /&gt;body に class=&quot;yui3-skin-sam&quot; を設定すると panel 表示時に、背景を薄暗くできます。&lt;br /&gt;panel は yui3.4 から利用できるようです。&lt;br /&gt;&lt;br /&gt;サンプル画面&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBD_-0JtHIGJeCC7jhIryz4yHkZML4aT2KWtQVnQbhUYMueGNAJQjHfwuGLnBklgfCk-iRrRC6hceZNWGOY9W90L2-rY8utK26IclPmCkFDsmsa5hQ4ZgU7Co7Z2KDBM6qzqHEDluoMSM/s1600/panel.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 200px; height: 116px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBD_-0JtHIGJeCC7jhIryz4yHkZML4aT2KWtQVnQbhUYMueGNAJQjHfwuGLnBklgfCk-iRrRC6hceZNWGOY9W90L2-rY8utK26IclPmCkFDsmsa5hQ4ZgU7Co7Z2KDBM6qzqHEDluoMSM/s200/panel.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5677149855021041810&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://yuilibrary.com/yui/docs/panel/&quot;&gt;yuiドキュメント&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;自分はフロント系が苦手なので、もう少し js 、html に強くなるため YUI 関連も引き続き調べていこうと思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/5421907124050860638/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/yui3-panel.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/5421907124050860638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/5421907124050860638'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/yui3-panel.html' title='YUI3 でpanel表示'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBD_-0JtHIGJeCC7jhIryz4yHkZML4aT2KWtQVnQbhUYMueGNAJQjHfwuGLnBklgfCk-iRrRC6hceZNWGOY9W90L2-rY8utK26IclPmCkFDsmsa5hQ4ZgU7Co7Z2KDBM6qzqHEDluoMSM/s72-c/panel.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-3098712726713798730</id><published>2011-11-14T01:48:00.031+09:00</published><updated>2011-11-14T03:15:08.695+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php goto文</title><content type='html'>PHP5.3からgoto文がサポートされた。&lt;br /&gt;詳しくはマニュアルを&lt;br /&gt;&lt;a href=&quot;http://www.php.net/manual/ja/control-structures.goto.php&quot;&gt;http://www.php.net/manual/ja/control-structures.goto.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;goto文はCやperlでもあります。&lt;br /&gt;goto文はあまり使わないようにとされているようです。&lt;br /&gt;確かに使い方を誤るともの凄くソースが読みづらくなります。&lt;br /&gt;上から下に進んでいくのに、下から上にjumpするように書かれていたりなどしたら、ソースを読む時に処理を追い辛くてしょうがないですね。&lt;br /&gt;エラー時や特定時のみ利用するのがいいみたいです。&lt;br /&gt;&lt;br /&gt;特定時のみ使うのであれば有効かと思い、軽くパフォーマンスを見てみました。&lt;br /&gt;結果は以下のようになっています。&lt;br /&gt;&lt;br /&gt;goto文&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$j = 0;&lt;br /&gt;for ($i=0;$i&lt;10000000;$i++) {&lt;br /&gt;    goto A;&lt;br /&gt;&lt;br /&gt;    A : {&lt;br /&gt;        $j++;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo $j;&lt;br /&gt;exit(0);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;実行結果&lt;br /&gt;&lt;fieldset&gt;&lt;br /&gt;$ time php goto.php &lt;br /&gt;10000000&lt;br /&gt;real 0m1.290s&lt;br /&gt;user 0m1.152s&lt;br /&gt;sys 0m0.036s&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;関数&lt;br /&gt;&lt;pre class=&quot;brush: php&quot;&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;$j = 0;&lt;br /&gt;for ($i=0;$i&lt;10000000;$i++) {&lt;br /&gt;    calc($j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo $j;&lt;br /&gt;exit(0);&lt;br /&gt;&lt;br /&gt;function calc(&amp;$j) {&lt;br /&gt;    $j++;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;実行結果&lt;br /&gt;&lt;fieldset&gt;&lt;br /&gt;$ time php func.php &lt;br /&gt;10000000&lt;br /&gt;real 0m3.087s&lt;br /&gt;user 0m2.760s&lt;br /&gt;sys 0m0.052s&lt;br /&gt;&lt;/fieldset&gt;&lt;br /&gt;&lt;br /&gt;goto文の方が早いですね。&lt;br /&gt;関数を呼ぶオーバヘッドが無いからかな？&lt;br /&gt;&lt;br /&gt;一度の処理で、複数回のエラー処理をしないといけないときなどは、関数化するよりもgoto文を使うのもありかもですね。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/3098712726713798730/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/php-goto.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3098712726713798730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3098712726713798730'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/php-goto.html' title='php goto文'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-3557984902999269359</id><published>2011-11-10T01:25:00.015+09:00</published><updated>2012-04-06T00:38:18.405+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>ubuntu に apache + php インストール</title><content type='html'>昨日インストールした vm 上の ubuntu に apache と php をインストールします。&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;apache インストール&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
1.  sudo apt-get install apache2&lt;br /&gt;
→ 途中でインストールするか Y/n で聞かれるので、Y を入力&lt;br /&gt;
&lt;br /&gt;
2. dpkg -l | grep apache (表示内容一部省略)&lt;br /&gt;
&lt;blockquote&gt;
apache2&lt;br /&gt;
apache2-mpm-worker&lt;br /&gt;
apache2-utils&lt;br /&gt;
apache2.2-bin&lt;br /&gt;
apache2.2-common&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
※ dpkg -L apache2 の結果&lt;br /&gt;
&lt;blockquote&gt;
/.&lt;br /&gt;
/usr&lt;br /&gt;
/usr/share&lt;br /&gt;
/usr/share/bug&lt;br /&gt;
/usr/share/bug/apache2&lt;br /&gt;
/usr/share/bug/apache2/control&lt;br /&gt;
/usr/share/doc&lt;br /&gt;
/usr/share/bug/apache2/script&lt;br /&gt;
/usr/share/doc/apache2&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
3. ブラウザで確認&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN_3Lhhh1C6lSqVIScDaPN_2PvqTxLKsUtW1lO7PRNkIAzRtD80FBk_ouXPyGRBtpITfbIub7G-f2hsH0eGoz2lB4PtZezthk8mSv-KGx8BjFAjKx-l01voFUtT9_I1AuiNNWo4cm_qAk/s1600/apache2_localhost.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5673040026077291010&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN_3Lhhh1C6lSqVIScDaPN_2PvqTxLKsUtW1lO7PRNkIAzRtD80FBk_ouXPyGRBtpITfbIub7G-f2hsH0eGoz2lB4PtZezthk8mSv-KGx8BjFAjKx-l01voFUtT9_I1AuiNNWo4cm_qAk/s200/apache2_localhost.png&quot; style=&quot;cursor: hand; cursor: pointer; height: 93px; width: 200px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
上記画像の用に表示されれば、apache のインストール完了&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;php&lt;/span&gt; インストール&lt;br /&gt;
&lt;br /&gt;
1. sudo apt-get install php5&lt;br /&gt;
→ apache の時と同じく Y を入力&lt;br /&gt;
&lt;br /&gt;
2. dpkg -l | grep php (表示内容一部省略)&lt;br /&gt;
&lt;blockquote&gt;
libapache2-mod-php5&lt;br /&gt;
php5&lt;br /&gt;
php5-cli&lt;br /&gt;
php5-common             &lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
※ dpkg -L php5 の結果&lt;br /&gt;
&lt;blockquote&gt;
/.&lt;br /&gt;
/usr&lt;br /&gt;
/usr/share&lt;br /&gt;
/usr/share/doc&lt;br /&gt;
/usr/share/doc/php5&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
3. php -v の結果&lt;br /&gt;
&lt;blockquote&gt;
PHP 5.3.6-13ubuntu3.2 with Suhosin-Patch (cli) (built: Oct 13 2011 23:19:13)&lt;br /&gt;
Copyright (c) 1997-2011 The PHP Group&lt;br /&gt;
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies&lt;/blockquote&gt;
&lt;br /&gt;
php5.3.6 がインストールされるみたいです&lt;br /&gt;
&lt;br /&gt;
4. ブラウザで定番の Hello World 出力&lt;br /&gt;
何も設定せずに、ブラウザで開こうとすると、php ファイルをダウンロードしますかみたいに表示される。&lt;br /&gt;
yas さんのブログを参考に設定したところ、無事表示されました。&lt;br /&gt;
&lt;a href=&quot;http://perltips.twinkle.cc/linux/ubuntu/apache/php/settings&quot;&gt;http://perltips.twinkle.cc/linux/ubuntu/apache/php/settings&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoNnWoqMdE3kwQ6yDOnHx1cfHvUbt0MWhj5m8pievfZdy5FwhHCidsJ4EgUU3qD_w2jAdbar3CYXJhzzOStQ40hfxHDyu3D3rRk6iBoCGxMaw7ZQVjPIrJg1ok5aEZ0N5L28nIXCKJya0/s1600/hello.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5673049621284532498&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoNnWoqMdE3kwQ6yDOnHx1cfHvUbt0MWhj5m8pievfZdy5FwhHCidsJ4EgUU3qD_w2jAdbar3CYXJhzzOStQ40hfxHDyu3D3rRk6iBoCGxMaw7ZQVjPIrJg1ok5aEZ0N5L28nIXCKJya0/s200/hello.png&quot; style=&quot;cursor: hand; cursor: pointer; height: 76px; width: 200px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
とりあえず、設定完了。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
※ 補足&lt;br /&gt;
apache の再起動は以下のコマンドで可能&lt;br /&gt;
&lt;blockquote&gt;
sudo /etc/init.d/apache2 restart&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/3557984902999269359/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/ubuntu-apache-php.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3557984902999269359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/3557984902999269359'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/ubuntu-apache-php.html' title='ubuntu に apache + php インストール'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN_3Lhhh1C6lSqVIScDaPN_2PvqTxLKsUtW1lO7PRNkIAzRtD80FBk_ouXPyGRBtpITfbIub7G-f2hsH0eGoz2lB4PtZezthk8mSv-KGx8BjFAjKx-l01voFUtT9_I1AuiNNWo4cm_qAk/s72-c/apache2_localhost.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-158226350135722575.post-6843581995527636705</id><published>2011-11-09T00:52:00.009+09:00</published><updated>2011-11-09T01:15:50.249+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="vmware"/><title type='text'>Ubuntu 11.10 インストール</title><content type='html'>&lt;span style=&quot;font-size:100%;&quot;&gt;Ubuntu 11.10 を自宅の Windows Vista にインストールする。&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;VMWARE PLAYER が 4.0 になっていたので、 3.0 をアンインストールして 4.0 を入れ直して、&lt;br /&gt;心機一転する。&lt;br /&gt;VMWARE PLAYER はユーザー登録をして&lt;br /&gt;&lt;a href=&quot;http://www.vmware.com/jp/products/desktop_virtualization/player/overview&quot;&gt;http://www.vmware.com/jp/products/desktop_virtualization/player/overview&lt;/a&gt;&lt;br /&gt;上記のダウンロードボタンから。&lt;br /&gt;&lt;br /&gt;Ubuntu 11.10 の ISO は&lt;br /&gt;&lt;a href=&quot;http://www.ubuntulinux.jp/News/ubuntu1110-desktop-ja-remix&quot;&gt;http://www.ubuntulinux.jp/News/ubuntu1110-desktop-ja-remix&lt;/a&gt;&lt;br /&gt;上記のリンク先からダウンロード。&lt;br /&gt;&lt;br /&gt;初回は何も考えずに、ISO を読み込ませていたら、日本語ではないし、インストール画面は GUI だったが、いざ起動したら何故か CUI のみだった。&lt;br /&gt;なので、一度削除してググったところ猫おやじさんのブログがヒット。&lt;br /&gt;猫おやじさんのブログは画像付きで非常に丁寧な解説なので、下記リンクの記事通りの手順を行ったところ、問題なくスムーズにインストール完了しました。&lt;br /&gt;&lt;a href=&quot;http://itneko.blogspot.com/2011/10/ubuntu-1110-on-vmware-player-4x.html&quot;&gt;http://itneko.blogspot.com/2011/10/ubuntu-1110-on-vmware-player-4x.html&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;これにて、セットアップ完了。&lt;br /&gt;時間があるときに、色々といじってみようと思います。</content><link rel='replies' type='application/atom+xml' href='http://ikkuntech.blogspot.com/feeds/6843581995527636705/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/ubuntu-1110.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6843581995527636705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/158226350135722575/posts/default/6843581995527636705'/><link rel='alternate' type='text/html' href='http://ikkuntech.blogspot.com/2011/11/ubuntu-1110.html' title='Ubuntu 11.10 インストール'/><author><name>ikuo190world</name><uri>http://www.blogger.com/profile/11871431029418631367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>