Microsoft Silverlight を取得

カテゴリー : php

このカテゴリーの登録数:31件 表示 : 1 - 5 / 31

2008-10-28

p_blog プラグイン

p_blog プラグインでデータベースを使うと、カテゴリーや最近の5件などが消えてしまう
プラグインの最終行で
$db = mysql_select_db("p_blog");
mysql_select_dbで元のデータベースに戻す

2008-09-30

p_blog ping

p_blogで更新PINGのエラー処理をキャンセルした
trackback/include/fnc_trackback.inc.php
return 'Socket error!'; を continueに変更

2008-09-28

php gdインストール

libjpegのインストール
tar zxfv jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure --enable-shared
make
libtoolがないといわれるので
vi config.status
s%@LIBTOOL@%/usr/bin/libtool%g
make
make install
make install-lib

libpngのインストール
tar zxfv libpng-1.2.32
cd libpng-1.2.32
./configure
make
make install

freetype2のインストール
tar zxfv freetype-2.3.7.tar.gz
cd freetype-2.3.7
./configure
make
make install

phpのインストール
cd php-5.2.6
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/bin/mysql_config --with-mysql=/usr/local/ --enable-mbstring --enable-mbregex --with-curl=/usr/local/ --with-curlwrappers --with-gd --with-jpeg-dir --with-png-dir --with-zlib --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --without-sqlite --disable-cgi --with-mcrypt
make
make install

phpのmake時にltdlがないといわれる
cd libmcrypt-2.5.8
cd libltdl
./configure --enable-ltdl-install
make
make install

2008-09-20

phpMyAdmin

phpMyAdminのためにphpにmcryptを入れる

tar zxfv libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure -disable-posix-threads
make
su -
make install

phpのコンパイル
cd /src/php-5.2.6
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/bin/mysql_config --with-mysql=/usr/local/ --enable-mbstring --enable-mbregex --with-curl=/usr/local/ --with-curlwrappers --with-gd --with-jpeg-dir=/usr/local/lib/ --with-png-dir=/usr/local/lib/ --with-zlib --with-freetype-dir=/usr/local/lib/ --without-sqlite --disable-cgi --with-mcrypt=/usr/local/lib/
make
su -
make install

httpd restart

2006-09-18

掲示板スパム対策

自作のphp掲示板へADJUSTABLE BEDやLEVITRAなどの内容のスパム
が大量に投稿されているので大変困っていました。
他の掲示板を見てみてもこのスパムがたくさん投稿されていました

対策として掲示板のトップで$_SERVER['HTTP_REFERER']を$_SESSION['referer']に記録して
データベース書込み時に$_SESSION['referer']が空や正当な値ではないときに書き込みを行わないようにしました。
これでこのスパムはすべてはじかれるようにになりました。