タイトル画像のアニメーション
テーマ : JavaScript(ジャバスクリプト)
ジャンル : コンピュータ
アナログ時計の作成
FC2に設置する方法
管理画面→プラグインの設定→公式プラグイン追加→拡張プラグイン フリーエリア
により、フリーエリアを追加。
フリーエリアに、以下のコードを貼り付けるだけ。
<center>
<div style="position: relative;">
<img src="http://blog-imgs-36.fc2.com/c/h/o/chocomoca9/analog-clock-base.png">
<div class="hourHand" style="width:104px;height:104px;background-image:url(http://blog-imgs-36.fc2.com/c/h/o/chocomoca9/analog-clock-hands.png);background-repeat:no-repeat;top:2px;left:41px;position:absolute;"></div>
<div class="minuteHand" style="width:104px;height:104px;background-image:url(http://blog-imgs-36.fc2.com/c/h/o/chocomoca9/analog-clock-hands.png);background-repeat:no-repeat;top:2px;left:41px;position:absolute;"></div>
<div class="secondHand" style="width:104px;height:104px;background-image:url(http://blog-imgs-36.fc2.com/c/h/o/chocomoca9/analog-clock-hands.png);background-repeat:no-repeat;top:2px;left:41px;position:absolute;"></div>
</div>
<script type="text/javascript" src="http://blog-imgs-36.fc2.com/c/h/o/chocomoca9/jquery-min.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
$(document).ready(function() {
animation();
setInterval(function(){
animation();
}, 1000);
function animation() {
var currentTime = new Date();
var s = currentTime.getSeconds();
var m = currentTime.getMinutes();
var h = Math.floor(5*(currentTime.getHours()%12)+m/12);
$('.hourHand').css('background-position', -h*104+'px 0px');
$('.minuteHand').css('background-position', -m*104+'px -104px');
$('.secondHand').css('background-position', -s*104+'px -208px');
}
});
/*]]>*/
</script>
</center>
こんなこともできるFC2、恐るべし。
テーマ : JavaScript(ジャバスクリプト)
ジャンル : コンピュータ
PECL
(1)PHP5.3.1のソースの入手
http://jp2.php.net/get/php-5.3.1.tar.gz/from/a/mirror
(2)コンパイル
phpinfo()の表示により、configureパラメータを確認し、そのままコピーアンドペースト。
たしかに、/usr/sbin/apxsと指定しているが、そこにapxsが無い。$ './configure' '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--target=i686-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--with-t1lib=/usr' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--without-sqlite3' '--disable-phar' '--disable-fileinfo' '--disable-json' '--without-pspell' '--disable-wddx' '--without-curl' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem'
:
Configuring SAPI modules
checking for AOLserver support... no
checking for Apache 1.x module support via DSO through APXS... no
checking for Apache 1.x module support... no
checking whether to enable Apache charset compatibility option... no
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /usr/sbin/apxs follows:
./configure: line 6542: /usr/sbin/apxs: No such file or directory
configure: error: Aborting
ググると、
とのことで、apache-develを入れないといけないようだ。apache-develというパッケージは無く、httpd-develという情報を得た。パッケージの場合、apxsコマンドは、apache-xxx.rpm ではなく、開発用の
apache-devel-xxx.rpm に含まれています。
# yum install httpd-devel
で、さくっとインストールできた。apxsの場所は正しく/usr/sbin/apxsとなったので再実行。
エラーで止まってしまったので、libxml2をインストールしようとしたが、既に入っているとのこと。xml2-configが無いとのことで調べたらlibxml2-develを入れる必要がある。$ './configure' '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' ...
:
Configuring extensions
checking size of long... (cached) 4
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
# yum install libxml2-devel
configure: error: Cannot find OpenSSL's <evp.h>
opensslは入っているので、例によってopenssl-develをインストール。
checking for PCRE headers location... configure: error: Could not find pcre.h in /usr
# yum install pcre-devel
configure: error: Please reinstall the BZip2 distribution
# yum install bzip2-devel
configure: error: Unable to locate gmp.h
# yum install gmp-devel
:
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
Thank you for using PHP.
Notice: Following unknown configure options were used:
--without-mime-magic
--with-system-tzdata
Check './configure --help' for available options
とりあえず、phpのコンフィグが完了した。
格安サーバのyiiの使用可能性
http://lolipop.jp/
月額約330円で、広告無し、PHP、MySQL、SQLite使用可能。yiiの要求仕様は、
http://pugpug.lolipop.jp/requirements/
で、かなり良い。PDO, PDO SQLite, PDO MySQLに全て対応。
早速アプリを転送したが、問題無く動作するばかりか、かなり高速。有償サーバなので当たり前と言えば当たり前。
安いので加入しようかな。
テーマ : ホスティングサービス
ジャンル : コンピュータ




