●Maximum execution time of 30 seconds exceededの対応方法
set_time_limit(60);
« MySQL | メイン | PostgreSQL »
set_time_limit(60);
array_search -- 指定した値を配列で検索し、見つかった場合に対応するキーを返す
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array); // $key = 1;
#!/usr/bin/perl
print "Content-type: text/html\n\n
";\n";
foreach (sort keys %ENV) { print "$_ = $ENV{$_}\n"; }
print "
PHP拡張モジュールをコピーし、php.iniに拡張モジュールエントリを追加します。
bind/php/php-43x/libpdf_php.so
# cp bind/php/php-43x/libpdf_php.so /usr/local/lib/php/20070927/
extension_dir = /usr/local/lib/php/20070927/
extension = libpdf_php.so
function check_spammer(){
$re_flg = 0;
$ip = getenv("REMOTE_ADDR");
if($ip == "127.0.0.1")
$ip = "$HTTP_X_FORWARDED_FOR";
if(preg_match("/^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$/", $ip, $matches)){
$q1 = $matches[1];
$q2 = $matches[2];
$q3 = $matches[3];
$q4 = $matches[4];
$ip = "$q4.$q3.$q2.$q1";
}else{
}
// check list.dsbl.org, all.rbl.jp
$i = 0;
$check_list = array(".list.dsbl.org", ".all.rbl.jp");
while($i < count($check_list)){
$check = $ip . $check_list[$i];
$i ++;
$result = gethostbyname($check);
if ($result != $check) {
$re_flg = 1;
break;
} else {
}
}
return $re_flg;
}
?>
tar -xzvf php-4.4.7.tar.gz
tar -xzvf SQLite-1.0.3.tgz
mv SQLite-1.0.3 php-4.4.7/ext/sqlite
cd php-4.4.7
rm configure
./buildconf --force
./configure --with-sqlite
make
make install
FreeTypeの場合は「--with-ttf」、FreeType2の場合は「--with-freetype-dir」のオプションが必要です。