php查询字符串中包含的所有对称字符串

第一种:
[php]$str = 'sdjfhiuiyxhzzzzzulnjxzbbzxcsaaskanxksmsbbsmmsbbsmsgahkgjssdjfhiuiyxhzzzzzulnjxzbbzxcsaaskanxksmsbbsmmsbbsmgahkgjs';
preg_match_all('/(.)\1+/', $str, $matchs);
$len_s = array();
foreach ($matchs[0] as $ckv) {
$len = strlen($ckv);
if ($len % 2 == 0) {
$str_a = explode($ckv, $str);
checkLen($ckv, $str_a, $len_s);
} else {
$len_s[substr($ckv, 0, ($len - 1))] = $len - 1;
}
}</pre>
function checkLen($ckv, $str_a, &$len_s)
{
foreach ($str_a as $k => $v) {
if (isset($str_a[$k + 1])) {
$str1 = $str_a[$k];
$str2 = $str_a[$k + 1];
$str_len1 = strlen($str1);
$str_len2 = strlen($str2);
$count = min(array(
$str_len1,
$str_len2
));
$rckv = '';
for ($i = 0; $i < $count; $i ++) {
$sub1 = substr($str1, $str_len1 - $i, $i);
$sub2 = substr($str2, 0, $i);
if ($sub1 == strrev($sub2)) {
$rckv = $sub1 . $ckv . $sub2;
} else {
break;
}
}
$len_s[$rckv] = isset($len_s[$rckv]) && $len_s[$rckv] > strlen($rckv) ? $len_s[$rckv] : strlen($rckv);
}
}
}
<pre>[/php]

第二种:

[php]
function str(){
$str = 'kgfafbmrwrwrmbfdaa';
if($str===strrev($str) && strlen($str)%2==0){
echo $str;exit;
}
for($len = strlen($str)-1;$len>1;$len--) {//从最长的找
if($len%2>0){//奇数长度的直接跳过
continue;
}
for($i=0;$i<=strlen($str)-$len;$i++){//从第一位开始去取第一个for循环的长度
$str_1 = substr($str, $i, $len);
if ($str_1 === strrev($str_1) && strlen($str_1) % 2 == 0) {//取出来的字符串刚好是对称的直接中断查找
echo $i.' ooo '.$len.' '.$str_1;
exit;
}
}
}
}
str();exit;
[/php]

phpmyadmin配置远程连接数据库

将以下代码保存为config.inc.php放到phpmyadmin根目录下

[php]</p>
<p>$i = 0;<br />
$i++;<br />
$cfg[‘Servers’][$i][‘auth_type’] = ‘http';</p>
<p>$cfg[‘Servers’][$i][‘host’] = ‘192.168.1.221’;<br />
$cfg[‘Servers’][$i][‘connect_type’] = ‘http';<br />
$cfg[‘Servers’][$i][‘compress’] = false;</p>
<p>$cfg[‘Servers’][$i][‘extension’] = ‘mysqli';</p>
<p>$cfg[‘Servers’][$i][‘bs_garbage_threshold’] = 50;<br />
$cfg[‘Servers’][$i][‘bs_repository_threshold’] = ’32M';<br />
$cfg[‘Servers’][$i][‘bs_temp_blob_timeout’] = 600;<br />
$cfg[‘Servers’][$i][‘bs_temp_log_threshold’] = ’32M';</p>
<p>$cfg[‘UploadDir’] = ”;<br />
$cfg[‘SaveDir’] = ”;</p>
<p>[/php]

google无法访问、无法同步、无法登录的解决方法

打开:C:\Windows\System32\drivers\etc\hosts文件添加

[php]</p>
<p>#SmartHosts START</p>
<p>#Google Services START<br />
# google.com<br />
203.208.46.161 0.docs.google.com<br />
203.208.46.161 0.drive.google.com<br />
203.208.46.161 1.docs.google.com<br />
203.208.46.161 1.drive.google.com<br />
203.208.46.161 10.docs.google.com<br />
203.208.46.161 10.drive.google.com<br />
203.208.46.161 11.docs.google.com<br />
203.208.46.161 11.drive.google.com<br />
203.208.46.161 12.docs.google.com<br />
203.208.46.161 12.drive.google.com<br />
203.208.46.161 13.docs.google.com<br />
203.208.46.161 13.drive.google.com<br />
203.208.46.161 14.docs.google.com<br />
203.208.46.161 14.drive.google.com<br />
203.208.46.161 15.docs.google.com<br />
203.208.46.161 15.drive.google.com<br />
203.208.46.161 16.docs.google.com<br />
203.208.46.161 16.drive.google.com<br />
203.208.46.161 2.docs.google.com<br />
203.208.46.161 2.drive.google.com<br />
203.208.46.161 3.docs.google.com<br />
203.208.46.161 3.drive.google.com<br />
203.208.46.161 4.docs.google.com<br />
203.208.46.161 4.drive.google.com<br />
203.208.46.161 5.docs.google.com<br />
203.208.46.161 5.drive.google.com<br />
203.208.46.161 6.docs.google.com<br />
203.208.46.161 6.drive.google.com<br />
203.208.46.161 7.docs.google.com<br />
203.208.46.161 7.drive.google.com<br />
203.208.46.161 8.docs.google.com<br />
203.208.46.161 8.drive.google.com<br />
203.208.46.161 9.docs.google.com<br />
203.208.46.161 9.drive.google.com<br />
203.208.46.161 accounts.google.com<br />
203.208.46.161 accounts.l.google.com<br />
203.208.46.161 answers.google.com<br />
203.208.46.161 apis.google.com<br />
203.208.46.161 appengine.google.com<br />
203.208.46.161 apps.google.com<br />
203.208.46.161 appspot.l.google.com<br />
203.208.46.161 bks0.books.google.com<br />
203.208.46.161 bks1.books.google.com<br />
203.208.46.161 bks10.books.google.com<br />
203.208.46.161 bks2.books.google.com<br />
203.208.46.161 bks3.books.google.com<br />
203.208.46.161 bks4.books.google.com<br />
203.208.46.161 bks5.books.google.com<br />
203.208.46.161 bks6.books.google.com<br />
203.208.46.161 bks7.books.google.com<br />
203.208.46.161 bks8.books.google.com<br />
203.208.46.161 bks9.books.google.com<br />
203.208.46.161 blogsearch.google.com<br />
203.208.46.161 books.google.com<br />
203.208.46.161 browserchannel-docs.l.google.com<br />
203.208.46.161 browserchannel-spreadsheets.l.google.com<br />
203.208.46.161 browsersync.google.com<br />
203.208.46.161 browsersync.l.google.com<br />
203.208.46.161 buzz.google.com<br />
203.208.46.161 cache.l.google.com<br />
203.208.46.161 cache.pack.google.com<br />
203.208.46.161 calendar.google.com<br />
203.208.46.161 cbk0.google.com<br />
203.208.46.161 cbk1.google.com<br />
203.208.46.161 cbk2.google.com<br />
203.208.46.161 cbk3.google.com<br />
203.208.46.161 cbks0.google.com<br />
203.208.46.161 cbks1.google.com<br />
203.208.46.161 cbks2.google.com<br />
203.208.46.161 cbks3.google.com<br />
203.208.46.161 chart.apis.google.com<br />
203.208.46.161 chatenabled.mail.google.com<br />
203.208.46.161 checkout.google.com<br />
203.208.46.161 checkout.l.google.com<br />
203.208.46.161 chrome.google.com<br />
203.208.46.161 clients.l.google.com<br />
203.208.46.161 clients1.google.com<br />
203.208.46.161 clients2.google.com<br />
203.208.46.161 clients3.google.com<br />
203.208.46.161 clients4.google.com<br />
203.208.46.161 clients5.google.com<br />
203.208.46.161 clients6.google.com<br />
203.208.46.161 clients7.google.com<br />
203.208.46.161 code.google.com<br />
203.208.46.161 code.l.google.com<br />
203.208.46.161 csi.l.google.com<br />
203.208.46.161 desktop.google.com<br />
203.208.46.161 desktop.l.google.com<br />
203.208.46.161 desktop2.google.com<br />
203.208.46.161 developers.google.com<br />
203.208.46.161 ditu.google.com<br />
203.208.46.161 dl.google.com<br />
203.208.46.161 dl.l.google.com<br />
203.208.46.161 dl-ssl.google.com<br />
203.208.46.161 docs.google.com<br />
203.208.46.161 docs0.google.com<br />
203.208.46.161 docs1.google.com<br />
203.208.46.161 docs2.google.com<br />
203.208.46.161 docs3.google.com<br />
203.208.46.161 docs4.google.com<br />
203.208.46.161 docs5.google.com<br />
203.208.46.161 docs6.google.com<br />
203.208.46.161 docs7.google.com<br />
203.208.46.161 docs8.google.com<br />
203.208.46.161 docs9.google.com<br />
203.208.46.161 drive.google.com<br />
203.208.46.161 earth.google.com<br />
203.208.46.161 encrypted.google.com<br />
203.208.46.161 encrypted-tbn.l.google.com<br />
203.208.46.161 encrypted-tbn0.google.com<br />
203.208.46.161 encrypted-tbn1.google.com<br />
203.208.46.161 encrypted-tbn2.google.com<br />
203.208.46.161 encrypted-tbn3.google.com<br />
203.208.46.161 feedburner.google.com<br />
203.208.46.161 feedproxy.google.com<br />
203.208.46.161 filetransferenabled.mail.google.com<br />
203.208.46.161 finance.google.com<br />
203.208.46.161 fusion.google.com<br />
203.208.46.161 geoauth.google.com<br />
203.208.46.161 gg.google.com<br />
203.208.46.161 ghs.google.com<br />
203.208.46.161 ghs.l.google.com<br />
203.208.46.161 ghs46.google.com<br />
203.208.46.161 google.com<br />
203.208.46.161 googleapis.l.google.com<br />
203.208.46.161 googleapis-ajax.google.com<br />
203.208.46.161 googleapis-ajax.l.google.com<br />
203.208.46.161 googlecode.l.google.com<br />
203.208.46.161 google-public-dns-a.google.com<br />
203.208.46.161 google-public-dns-b.google.com<br />
203.208.46.161 goto.google.com<br />
203.208.46.161 groups.google.com<br />
203.208.46.161 groups.l.google.com<br />
203.208.46.161 groups-beta.google.com<br />
203.208.46.161 gxc.google.com<br />
203.208.46.161 id.google.com<br />
203.208.46.161 id.l.google.com<br />
203.208.46.161 images.google.com<br />
203.208.46.161 images.l.google.com<br />
203.208.46.161 investor.google.com<br />
203.208.46.161 jmt0.google.com<br />
203.208.46.161 kh.google.com<br />
203.208.46.161 kh.l.google.com<br />
203.208.46.161 khm.google.com<br />
203.208.46.161 khm.l.google.com<br />
203.208.46.161 khm0.google.com<br />
203.208.46.161 khm1.google.com<br />
203.208.46.161 khm2.google.com<br />
203.208.46.161 khm3.google.com<br />
203.208.46.161 khmdb.google.com<br />
203.208.46.161 khms.google.com<br />
203.208.46.161 khms.l.google.com<br />
203.208.46.161 khms0.google.com<br />
203.208.46.161 khms1.google.com<br />
203.208.46.161 khms2.google.com<br />
203.208.46.161 khms3.google.com<br />
203.208.46.161 labs.google.com<br />
203.208.46.161 large-uploads.l.google.com<br />
203.208.46.161 lh2.google.com<br />
203.208.46.161 lh2.l.google.com<br />
203.208.46.161 lh3.google.com<br />
203.208.46.161 lh4.google.com<br />
203.208.46.161 lh5.google.com<br />
203.208.46.161 lh6.google.com<br />
203.208.46.161 linkhelp.clients.google.com<br />
203.208.46.161 local.google.com<br />
203.208.46.161 m.google.com<br />
203.208.46.161 mail.google.com<br />
203.208.46.161 map.google.com<br />
203.208.46.161 maps.google.com<br />
203.208.46.161 maps.l.google.com<br />
203.208.46.161 maps-api-ssl.google.com<br />
203.208.46.161 mars.google.com<br />
203.208.46.161 mobile.l.google.com<br />
203.208.46.161 mobile-gtalk.l.google.com<br />
203.208.46.161 mobilemaps.clients.google.com<br />
203.208.46.161 mt.google.com<br />
203.208.46.161 mt.l.google.com<br />
203.208.46.161 mt0.google.com<br />
203.208.46.161 mt1.google.com<br />
203.208.46.161 mt2.google.com<br />
203.208.46.161 mt3.google.com<br />
203.208.46.161 mtalk.google.com<br />
203.208.46.161 mts.google.com<br />
203.208.46.161 mts.l.google.com<br />
203.208.46.161 mts0.google.com<br />
203.208.46.161 mts1.google.com<br />
203.208.46.161 mts2.google.com<br />
203.208.46.161 mts3.google.com<br />
203.208.46.161 music.google.com<br />
203.208.46.161 music-streaming.l.google.com<br />
203.208.46.161 mw1.google.com<br />
203.208.46.161 mw2.google.com<br />
203.208.46.161 news.google.com<br />
203.208.46.161 news.l.google.com<br />
203.208.46.161 pack.google.com<br />
203.208.46.161 photos.google.com<br />
203.208.46.161 photos-ugc.l.google.com<br />
203.208.46.161 picasa.google.com<br />
203.208.46.161 picasaweb.google.com<br />
203.208.46.161 picasaweb.l.google.com<br />
203.208.46.161 places.google.com<br />
203.208.46.161 productforums.google.com<br />
203.208.46.161 profiles.google.com<br />
203.208.46.161 reader.google.com<br />
203.208.46.161 safebrowsing.cache.l.google.com<br />
203.208.46.161 safebrowsing.clients.google.com<br />
203.208.46.161 safebrowsing.google.com<br />
203.208.46.161 safebrowsing-cache.google.com<br />
203.208.46.161 sandbox.google.com<br />
203.208.46.161 sb.google.com<br />
203.208.46.161 sb.l.google.com<br />
203.208.46.161 sb-ssl.google.com<br />
203.208.46.161 sb-ssl.l.google.com<br />
203.208.46.161 scholar.google.com<br />
203.208.46.161 scholar.l.google.com<br />
203.208.46.161 services.google.com<br />
203.208.46.161 sites.google.com<br />
203.208.46.161 sketchup.google.com<br />
203.208.46.161 sketchup.l.google.com<br />
203.208.46.161 spreadsheet.google.com<br />
203.208.46.161 spreadsheets.google.com<br />
203.208.46.161 spreadsheets.l.google.com<br />
203.208.46.161 spreadsheets0.google.com<br />
203.208.46.161 spreadsheets1.google.com<br />
203.208.46.161 spreadsheets2.google.com<br />
203.208.46.161 spreadsheets3.google.com<br />
203.208.46.161 spreadsheets4.google.com<br />
203.208.46.161 spreadsheets5.google.com<br />
203.208.46.161 spreadsheets6.google.com<br />
203.208.46.161 spreadsheets7.google.com<br />
203.208.46.161 spreadsheets8.google.com<br />
203.208.46.161 spreadsheets9.google.com<br />
203.208.46.161 spreadsheets-china.l.google.com<br />
203.208.46.161 suggestqueries.google.com<br />
203.208.46.161 suggestqueries.l.google.com<br />
203.208.46.161 support.google.com<br />
203.208.46.161 talkgadget.google.com<br />
203.208.46.161 tbn0.google.com<br />
203.208.46.161 tbn1.google.com<br />
203.208.46.161 tbn2.google.com<br />
203.208.46.161 tbn3.google.com<br />
203.208.46.161 toolbar.google.com<br />
203.208.46.161 toolbarqueries.clients.google.com<br />
203.208.46.161 toolbarqueries.google.com<br />
203.208.46.161 toolbarqueries.l.google.com<br />
203.208.46.161 tools.google.com<br />
203.208.46.161 tools.l.google.com<br />
203.208.46.161 translate.google.com<br />
203.208.46.161 trends.google.com<br />
203.208.46.161 upload.docs.google.com<br />
203.208.46.161 upload.drive.google.com<br />
203.208.46.161 uploadsj.clients.google.com<br />
203.208.46.161 video.google.com<br />
203.208.46.161 video-stats.l.google.com<br />
203.208.46.161 voice.google.com<br />
203.208.46.161 wallet.google.com<br />
203.208.46.161 wifi.google.com<br />
203.208.46.161 wifi.l.google.com<br />
203.208.46.161 wire.l.google.com<br />
203.208.46.161 writely.google.com<br />
203.208.46.161 writely.l.google.com<br />
203.208.46.161 writely-china.l.google.com<br />
203.208.46.161 writely-com.l.google.com<br />
203.208.46.161 www.google.com<br />
203.208.46.161 www.l.google.com<br />
203.208.46.161 www2.l.google.com<br />
203.208.46.161 www3.l.google.com<br />
203.208.46.161 www4.l.google.com<br />
203.208.46.161 ytstatic.l.google.com</p>
<p>&amp;nbsp;</p>
<p># googleusercontent.com<br />
203.208.46.170 0-open-opensocial.googleusercontent.com<br />
203.208.46.170 0-focus-opensocial.googleusercontent.com<br />
203.208.46.170 1-focus-opensocial.googleusercontent.com<br />
203.208.46.170 1-open-opensocial.googleusercontent.com<br />
203.208.46.170 2-focus-opensocial.googleusercontent.com<br />
203.208.46.170 2-open-opensocial.googleusercontent.com<br />
203.208.46.170 3-focus-opensocial.googleusercontent.com<br />
203.208.46.170 3hdrrlnlknhi77nrmsjnjr152ueo3soc-a-calendar-<br />
opensocial.googleusercontent.com<br />
203.208.46.170 3-open-opensocial.googleusercontent.com<br />
203.208.46.170 4fjvqid3r3oq66t548clrdj52df15coc-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 53rd6p0catml6vat6qra84rs0del836d-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 59cbv4l9s05pbaks9v77vc3mengeqors-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 8kubpeu8314p2efdd7jlv09an9i2ljdo-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 adstvca8k2ooaknjjmv89j22n9t676ve-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 blogger.googleusercontent.com<br />
203.208.46.170 bt26mravu2qpe56n8gnmjnpv2inl84bf-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 clients1.googleusercontent.com<br />
203.208.46.170 clients2.googleusercontent.com<br />
203.208.46.170 clients3.googleusercontent.com<br />
203.208.46.170 clients4.googleusercontent.com<br />
203.208.46.170 clients5.googleusercontent.com<br />
203.208.46.170 clients6.googleusercontent.com<br />
203.208.46.170 clients7.googleusercontent.com<br />
203.208.46.170 code-opensocial.googleusercontent.com<br />
203.208.46.170 debh8vg7vd93bco3prdajidmm7dhql3f-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 doc-00-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-08-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-0c-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-0g-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-0s-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-10-7o-docs.googleusercontent.com<br />
203.208.46.170 doc-14-7o-docs.googleusercontent.com<br />
203.208.46.170 feedback.googleusercontent.com<br />
203.208.46.170 googlehosted.l.googleusercontent.com<br />
203.208.46.170 hsco54a20sh11q9jkmb51ad2n3hmkmrg-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 i8brh95qor6r54nkl52hidj2ggcs4jgm-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 images1-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images2-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images3-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images4-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images5-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images6-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images7-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images8-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images9-focus-opensocial.googleusercontent.com<br />
203.208.46.170 images-docs-opensocial.googleusercontent.com<br />
203.208.46.170 k6v18tjr24doa89b55o3na41kn4v73eb-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 lh1.googleusercontent.com<br />
203.208.46.170 lh2.googleusercontent.com<br />
203.208.46.170 lh3.googleusercontent.com<br />
203.208.46.170 lh4.googleusercontent.com<br />
203.208.46.170 lh5.googleusercontent.com<br />
203.208.46.170 lh6.googleusercontent.com<br />
203.208.46.170 mail-attachment.googleusercontent.com<br />
203.208.46.170 music.googleusercontent.com<br />
203.208.46.170 music-onebox.googleusercontent.com<br />
203.208.46.170 oauth.googleusercontent.com<br />
203.208.46.170 ob7f2qc0i50kbjnc81vkhgmb5hsv7a8l-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 ode25pfjgmvpquh3b1oqo31ti5ibg5fr-a-<br />
calendar.opensocial.googleusercontent.com<br />
203.208.46.170 qhie5b8u979rnch1q0hqbrmbkn9estf7-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 r70rmsn4s0rhk6cehcbbcbfbs31pu0va-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 rbjhe237k979f79d87gmenp3gejfonu9-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 s1.googleusercontent.com<br />
203.208.46.170 s2.googleusercontent.com<br />
203.208.46.170 s3.googleusercontent.com<br />
203.208.46.170 s4.googleusercontent.com<br />
203.208.46.170 s5.googleusercontent.com<br />
203.208.46.170 s6.googleusercontent.com<br />
203.208.46.170 spreadsheets-opensocial.googleusercontent.com<br />
203.208.46.170 t.doc-0-0-sj.sj.googleusercontent.com<br />
203.208.46.170 themes.googleusercontent.com<br />
203.208.46.170 translate.googleusercontent.com<br />
203.208.46.170 u807isd5egseeabjccgcns005p2miucq-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 upt14k1i2veesusrda9nfotcrbp9d7p5-a-oz-opensocial.googleusercontent.com<br />
203.208.46.170 webcache.googleusercontent.com<br />
203.208.46.170 www.googleusercontent.com<br />
203.208.46.170 www-calendar-opensocial.googleusercontent.com<br />
203.208.46.170 www-fc-opensocial.googleusercontent.com<br />
203.208.46.170 www-focus-opensocial.googleusercontent.com<br />
203.208.46.170 www-gm-opensocial.googleusercontent.com<br />
203.208.46.170 www-kix-opensocial.googleusercontent.com<br />
203.208.46.170 www-open-opensocial.googleusercontent.com<br />
203.208.46.170 www-opensocial.googleusercontent.com<br />
203.208.46.170 www-opensocial-sandbox.googleusercontent.com<br />
203.208.46.170 www-oz-opensocial.googleusercontent.com</p>
<p>&amp;nbsp;<br />
# gstatic.com &amp; ggpht.com<br />
203.208.46.175 csi.gstatic.com<br />
203.208.46.175 g0.gstatic.com<br />
203.208.46.175 g1.gstatic.com<br />
203.208.46.175 g2.gstatic.com<br />
203.208.46.175 g3.gstatic.com<br />
203.208.46.175 maps.gstatic.com<br />
203.208.46.175 mt0.gstatic.com<br />
203.208.46.175 mt1.gstatic.com<br />
203.208.46.175 mt2.gstatic.com<br />
203.208.46.175 mt3.gstatic.com<br />
203.208.46.175 mt4.gstatic.com<br />
203.208.46.175 mt5.gstatic.com<br />
203.208.46.175 mt6.gstatic.com<br />
203.208.46.175 mt7.gstatic.com<br />
203.208.46.175 ssl.gstatic.com<br />
203.208.46.175 t0.gstatic.com<br />
203.208.46.175 t1.gstatic.com<br />
203.208.46.175 t2.gstatic.com<br />
203.208.46.175 t3.gstatic.com<br />
203.208.46.175 www.gstatic.com</p>
<p>203.208.46.170 lh1.ggpht.com<br />
203.208.46.170 lh2.ggpht.com<br />
203.208.46.170 lh3.ggpht.com<br />
203.208.46.170 lh4.ggpht.com<br />
203.208.46.170 lh5.ggpht.com<br />
203.208.46.170 lh6.ggpht.com<br />
203.208.46.170 nt0.ggpht.com<br />
203.208.46.170 nt1.ggpht.com<br />
203.208.46.170 nt2.ggpht.com<br />
203.208.46.170 nt3.ggpht.com<br />
203.208.46.170 nt4.ggpht.com<br />
203.208.46.170 nt5.ggpht.com<br />
# appspot.com, googleapis.com &amp; googlecode.com<br />
203.208.46.161 appspot.com<br />
173.194.64.141 chrometophone.appspot.com<br />
203.208.46.161 evolutionofweb.appspot.com<br />
203.208.46.161 googcloudlabs.appspot.com<br />
203.208.46.161 gv-gadget.appspot.com<br />
203.208.46.161 magnifier.blogspot.com<br />
203.208.46.161 moderator.appspot.com<br />
203.208.46.161 newsfeed-dot-latest-dot-rovio-ad-engine.appspot.com<br />
203.208.46.161 productideas.appspot.com<br />
203.208.46.161 project-slingshot-gp.appspot.com<br />
203.208.46.161 r2303.latest.project-slingshot-hr.appspot.com<br />
203.208.46.161 r3085-dot-latest-dot-project-slingshot-gp.appspot.com<br />
203.208.46.161 r3091-dot-latest-dot-project-slingshot-gp.appspot.com<br />
203.208.46.161 r3101-dot-latest-dot-project-slingshot-gp.appspot.com<br />
203.208.46.161 r3269-dot-latest-dot-project-slingshot-gp.appspot.com<br />
203.208.46.161 r3432-dot-latest-dot-project-slingshot-hr.appspot.com<br />
203.208.46.161 r4681-dot-latest-dot-project-slingshot-hr.appspot.com<br />
203.208.46.170 r7647-dot-latest-dot-project-slingshot-hr.appspot.com<br />
203.208.46.161 wcproxyx.appspot.com<br />
203.208.46.161 www.appspot.com</p>
<p>&amp;nbsp;</p>
<p>203.208.46.161 ajax.googleapis.com<br />
203.208.46.161 chart.googleapis.com<br />
203.208.46.161 fonts.googleapis.com<br />
203.208.46.161 maps.googleapis.com<br />
203.208.46.161 mt0.googleapis.com<br />
203.208.46.161 mt1.googleapis.com<br />
203.208.46.161 mt2.googleapis.com<br />
203.208.46.161 mt3.googleapis.com<br />
203.208.46.161 redirector-bigcache.googleapis.com<br />
203.208.46.161 translate.googleapis.com<br />
203.208.46.161 www.googleapis.com</p>
<p>203.208.46.161 autoproxy-gfwlist.googlecode.com<br />
203.208.46.161 chromium.googlecode.com<br />
203.208.46.161 closure-library.googlecode.com<br />
203.208.46.161 earth-api-samples.googlecode.com<br />
203.208.46.161 gmaps-samples-flash.googlecode.com<br />
203.208.46.161 google-code-feed-gadget.googlecode.com</p>
<p># local<br />
203.208.46.161 blogsearch.google.cn<br />
203.208.46.161 ditu.google.cn<br />
203.208.46.161 gg.google.cn<br />
203.208.46.161 id.google.cn<br />
203.208.46.161 maps.gstatic.cn<br />
203.208.46.161 m.google.cn<br />
203.208.46.161 mt.google.cn<br />
203.208.46.161 mt0.google.cn<br />
203.208.46.161 mt1.google.cn<br />
203.208.46.161 mt2.google.cn<br />
203.208.46.161 mt3.google.cn<br />
203.208.46.161 news.google.cn<br />
203.208.46.161 scholar.google.cn<br />
203.208.46.161 translate.google.cn<br />
203.208.46.161 www.google.cn<br />
203.208.46.161 www.gstatic.cn</p>
<p>203.208.46.161 accounts.google.com.hk<br />
203.208.46.161 blogsearch.google.com.hk<br />
203.208.46.161 books.google.com.hk<br />
203.208.46.161 clients1.google.com.hk<br />
203.208.46.161 desktop.google.com.hk<br />
203.208.46.161 encrypted.google.com.hk<br />
203.208.46.161 groups.google.com.hk<br />
203.208.46.161 gxc.google.com.hk<br />
203.208.46.161 id.google.com.hk<br />
203.208.46.161 images.google.com.hk<br />
203.208.46.161 m.google.com.hk<br />
203.208.46.161 maps.google.com.hk<br />
203.208.46.161 news.google.com.hk<br />
203.208.46.161 picasaweb.google.com.hk<br />
203.208.46.161 plus.url.google.com.hk<br />
203.208.46.161 scholar.google.com.hk<br />
203.208.46.161 toolbar.google.com.hk<br />
203.208.46.161 toolbarqueries.google.com.hk<br />
203.208.46.161 translate.google.com.hk<br />
203.208.46.161 translate.google.com.hk<br />
203.208.46.161 wenda.google.com.hk<br />
203.208.46.161 www.google.com.hk</p>
<p>&amp;nbsp;</p>
<p>#others<br />
203.208.46.161 android.googlesource.com<br />
203.208.46.161 auth.keyhole.com<br />
203.208.46.161 chrome.angrybirds.com<br />
203.208.46.161 chromium.org<br />
203.208.46.161 codereview.chromium.org<br />
203.208.46.161 dev.chromium.org<br />
203.208.46.161 developer.android.com<br />
203.208.46.161 domains.googlesyndication.com<br />
203.208.46.161 earthengine.googlelabs.com<br />
203.208.46.161 feeds.feedburner.com<br />
203.208.46.161 g.co<br />
203.208.46.161 gmail.com<br />
203.208.46.161 goo.gl<br />
203.208.46.162 listen.googlelabs.com<br />
203.208.46.161 m.gmail.com<br />
203.208.46.161 m.googlemail.com<br />
203.208.46.161 market.android.com<br />
203.208.46.163 ngrams.googlelabs.com<br />
203.208.46.222 ssl.google-analytics.com<br />
203.208.46.161 www.chromium.org<br />
203.208.46.161 www.gmail.com<br />
203.208.46.161 www.googleadservices.com<br />
203.208.46.222 www.google-analytics.com<br />
203.208.46.161 www.googlelabs.com<br />
203.208.46.222 www.googlesource.com</p>
<p>173.194.38.105 plus.google.com<br />
173.194.38.105 plus.url.google.com<br />
173.194.38.105 plusone.google.com<br />
#Google Services END</p>
<p>#Facebook Start<br />
69.171.228.25 0.facebook.com<br />
69.171.239.10 ah8.facebook.com<br />
69.63.189.53 api-read.facebook.com<br />
66.220.146.89 api.connect.facebook.com<br />
69.171.225.13 api.facebook.com<br />
69.171.229.39 apps.facebook.com<br />
61.213.189.98 b.static.ak.facebook.com<br />
61.213.189.120 b.static.ak.fbcdn.net<br />
66.220.145.57 beta.facebook.com<br />
66.220.145.63 bigzipfiles.facebook.com<br />
61.213.189.113 creative.ak.fbcdn.net<br />
97.65.135.139 external.ak.fbcdn.net<br />
69.171.224.40 c.facebook.com<br />
69.171.241.10 chat.facebook.com<br />
66.220.144.11 chat.thefacebook.com<br />
66.220.147.11 check4.facebook.com<br />
69.171.228.40 check6.facebook.com<br />
184.31.111.139 connect.facebook.net<br />
69.171.227.19 creativeupload.facebook.com<br />
69.171.240.99 d.facebook.com<br />
66.220.156.33 developers.facebook.com<br />
69.171.224.27 error.facebook.com<br />
69.171.225.13 facebook.com<br />
61.213.189.113 fbcdn.net<br />
80.67.74.111 fbcdn-photos-a.akamaihd.net<br />
64.213.102.26 fbcdn-profile-a.akamaihd.net<br />
173.223.232.67 fbcdn-sphotos-a.akamaihd.net<br />
69.171.239.10 glb.facebook.com<br />
69.171.239.10 glb1.facebook.com<br />
66.220.147.16 graph.facebook.com<br />
69.171.228.27 groups.facebook.com<br />
69.63.180.186 hphotos-ak-snc1.facebook.com<br />
69.63.180.186 hphotos-ak-snc3.facebook.com<br />
69.171.240.10 hphotos-ash4.fbcdn.net<br />
69.63.183.180 hphotos-pao1.fbcdn.net<br />
69.63.183.51 hphotos-sjc1.fbcdn.net<br />
69.63.180.186 hphotos-snc1.fbcdn.net<br />
69.63.183.3 hphotos-snc3.fbcdn.net<br />
66.220.151.22 hphotos-snc6.fbcdn.net<br />
69.171.227.24 hphotos-snc7.fbcdn.net<br />
66.220.147.55 iphone.facebook.com<br />
69.63.177.71 irc.tfbnw.net<br />
66.220.144.43 ldap.thefacebook.com<br />
66.220.144.49 legacymail.thefacebook.com<br />
69.171.229.34 m.facebook.com<br />
69.171.239.10 mx.facebook.com<br />
69.63.190.12 o.facebook.com<br />
69.171.227.28 orcart.facebook.com<br />
69.63.186.26 photos-ak-ash1.facebook.com<br />
69.63.186.24 photos-ash1.facebook.com<br />
69.171.229.35 pixel.facebook.com<br />
69.171.240.14 pixmail.vip.tfbnw.net<br />
118.214.190.105 profile.ak.facebook.com<br />
61.213.189.114 profile.ak.fbcdn.net<br />
66.220.155.43 s-static.facebook.com<br />
66.220.144.97 sb-dev.thefacebook.com<br />
66.220.144.98 sb-test.thefacebook.com<br />
66.220.144.99 sb.thefacebook.com<br />
61.213.189.113 s-hprofile-sf2p.fbcdn.net<br />
118.214.114.110 s-static.ak.facebook.com<br />
69.63.178.68 secure-media.facebook.com<br />
69.63.178.67 secure-media.fbcdn.net<br />
69.63.181.57 secure-media-sf2p.facebook.com<br />
66.220.145.59 secure-profile.facebook.com<br />
69.171.231.10 secure.facebook.com<br />
69.171.239.10 spraydns.fbops.com<br />
69.63.181.15 ssl.facebook.com<br />
69.171.228.44 ssl.connect.facebook.com<br />
69.63.189.76 star.facebook.com<br />
61.213.189.98 static.ak.facebook.com<br />
97.65.135.163 static.ak.fbcdn.net<br />
69.171.239.10 static.facebook.com<br />
66.220.155.43 static.thefacebook.com<br />
66.220.147.58 touch.facebook.com<br />
69.171.229.17 upload.facebook.com<br />
66.220.144.41 vpn.tfbnw.net<br />
120.29.145.50 vthumb.ak.fbcdn.net<br />
66.220.151.31 vupload.facebook.com<br />
69.171.225.31 www.connect.facebook.com<br />
69.171.225.13 www.facebook.com<br />
66.220.146.61 www.fbplugin.com<br />
#Facebook End</p>
<p>&amp;nbsp;</p>
<p>#Dropbox START<br />
199.47.217.179 dropbox.com<br />
199.47.216.170 www.dropbox.com<br />
#107.20.207.62 dl.dropbox.com<br />
#107.20.207.62 dl-web.dropbox.com<br />
174.36.51.42 forums.dropbox.com<br />
174.36.51.42 wiki.dropbox.com<br />
#Dropbox END</p>
<p>#Flickr START<br />
66.94.233.186 flickr.com<br />
66.94.233.186 www.flickr.com<br />
68.142.214.43 static.flickr.com<br />
66.196.118.49 farm1.static.flickr.com<br />
69.147.90.159 farm2.static.flickr.com<br />
76.13.18.78 farm3.static.flickr.com<br />
67.195.19.66 farm4.static.flickr.com<br />
76.13.18.79 farm5.static.flickr.com<br />
98.139.197.254 farm6.static.flickr.com<br />
98.139.102.46 farm7.static.flickr.com<br />
98.136.43.76 geo.yahoo.com<br />
68.142.250.161 l.yimg.com<br />
96.6.93.227 s.yimg.com<br />
98.137.88.88 d.yimg.com<br />
68.142.196.57 c5.ah.yahoo.com<br />
124.108.120.124 sa.edit.yahoo.com<br />
76.13.6.132 row.bc.yahoo.com<br />
66.163.168.247 open.login.yahoo.com<br />
209.191.92.114 login.yahoo.com<br />
209.191.92.115 edit.yahoo.com<br />
209.191.121.31 up.flickr.com<br />
209.191.105.102 adjax.flickr.yahoo.com<br />
204.0.5.35 content.yieldmanager.edgesuite.net<br />
76.13.6.132 us.bc.yahoo.com<br />
204.0.5.34 us.js2.yimg.com</p>
<p>#data from HostsX<br />
76.13.18.78 bf1.farm3.static.flickr.com<br />
76.13.18.78 farm3.static.flickr.com<br />
76.13.18.78 gq1.farm3.static.flickr.com<br />
76.13.18.78 sp1.farm3.static.flickr.com<br />
76.13.18.79 bf1.farm5.static.flickr.com<br />
76.13.18.79 farm5.static.flickr.com<br />
76.13.18.79 gq1.farm5.static.flickr.com<br />
98.139.102.46 bf1.farm7.static.flickr.com<br />
98.139.102.46 farm7.static.flickr.com<br />
98.139.102.46 gq1.farm7.static.flickr.com<br />
98.139.102.46 ne1.farm7.static.flickr.com<br />
98.139.197.254 bf1.farm6.static.flickr.com<br />
98.139.197.254 farm6.static.flickr.com<br />
98.139.197.254 gq1.farm6.static.flickr.com<br />
#Flickr END</p>
<p>#Adobe Activation START<br />
0.0.0.0 3dns-2.adobe.com<br />
0.0.0.0 3dns-3.adobe.com<br />
0.0.0.0 activate.adobe.com<br />
0.0.0.0 activate-sea.adobe.com<br />
0.0.0.0 activate-sjc0.adobe.com<br />
0.0.0.0 adobe-dns.adobe.com<br />
0.0.0.0 adobe-dns-2.adobe.com<br />
0.0.0.0 adobe-dns-3.adobe.com<br />
0.0.0.0 ereg.adobe.com<br />
0.0.0.0 hl2rcv.adobe.com<br />
0.0.0.0 practivate.adobe.com<br />
0.0.0.0 wip3.adobe.com<br />
0.0.0.0 activate.wip3.adobe.com<br />
0.0.0.0 ereg.wip3.adobe.com<br />
0.0.0.0 wwis-dubc1-vip60.adobe.com<br />
#Adobe Activation END</p>
<p>#Wikipedia START<br />
208.80.152.201 wikipedia.org<br />
208.80.152.201 www.wikipedia.org<br />
208.80.152.201 bits.wikipedia.org<br />
208.80.152.201 en.wikipedia.org<br />
208.80.152.201 zh.wikipedia.org<br />
208.80.152.201 simple.wikipedia.org<br />
208.80.152.201 wikibooks.org<br />
208.80.152.201 www.wikibooks.org<br />
208.80.152.201 en.wikibooks.org<br />
208.80.152.201 zh.wikibooks.org<br />
208.80.152.201 wikinews.org<br />
208.80.152.201 www.wikinews.org<br />
208.80.152.201 en.wikinews.org<br />
208.80.152.201 zh.wikinews.org<br />
208.80.152.201 wikiquote.org<br />
208.80.152.201 www.wikiquote.org<br />
208.80.152.201 en.wikiquote.org<br />
208.80.152.201 zh.wikiquote.org<br />
208.80.152.201 zh.wikisource.org<br />
208.80.152.201 en.wikisource.org<br />
208.80.152.201 wiktionary.org<br />
208.80.152.201 www.wiktionary.org<br />
208.80.152.201 en.wiktionary.org<br />
208.80.152.201 zh.wiktionary.org<br />
208.80.152.201 wikimedia.org<br />
208.80.152.201 www.wikimedia.org<br />
208.80.152.201 bugs.wikimedia.org<br />
208.80.152.201 bugzilla.wikimedia.org<br />
208.80.152.201 commons.wikimedia.org<br />
208.80.152.201 dumps.wikimedia.org<br />
208.80.152.201 download.wikimedia.org<br />
208.80.152.201 irc.wikimedia.org<br />
208.80.152.201 ftp.wikimedia.org<br />
208.80.152.201 ganglia.wikimedia.org<br />
208.80.152.201 mail.wikimedia.org<br />
208.80.152.201 meta.wikimedia.org<br />
208.80.152.201 news.wikimedia.org<br />
208.80.152.201 noc.wikimedia.org<br />
208.80.152.201 kate.wikimedia.org<br />
208.80.152.201 kohl.wikimedia.org<br />
208.80.152.201 stats.wikimedia.org<br />
208.80.152.201 ticket.wikimedia.org<br />
208.80.152.201 tools.wikimedia.org<br />
208.80.152.211 upload.wikimedia.org<br />
208.80.152.201 wikimediafoundation.org<br />
208.80.152.201 www.wikimediafoundation.org<br />
208.80.152.201 mediawiki.org<br />
208.80.152.201 www.mediawiki.org<br />
#Wikipedia END</p>
<p>&amp;nbsp;</p>
<p>#YouTube START<br />
203.208.45.206 apiblog.youtube.com<br />
203.208.45.206 help.youtube.com<br />
203.208.45.206 i.ytimg.com<br />
203.208.45.206 i1.ytimg.com<br />
203.208.45.206 i2.ytimg.com<br />
203.208.45.206 i3.ytimg.com<br />
203.208.45.206 i4.ytimg.com<br />
203.208.45.206 insight.youtube.com<br />
203.208.45.206 m.youtube.com<br />
203.208.45.206 s.ytimg.com<br />
203.208.45.206 ytimg.l.google.com<br />
#YouTube END</p>
<p>#SmartHosts END</p>
<p>[/php]

同一个顶级域名下的session共享方案

平时开发的小网站一般使用单个域名放到单个服务器上就可以了,那么,如果在同一个网站下使用多个子域名的时候,问题就来了,session不允许跨域,也就是说在a.test.com中设置的session到
b.test.com中不不存在了,怎么办?解决方法是让同一个主域名下的session可以共享,用以下3种方式:
1、在程序入口文件且在session_start()之前,设置:
ini_set(‘session.cookie_domain’, ‘.test.com’);
ini_set(‘session.cookie_lifetime’, ‘1800’);
2、php.ini中设置:
session.cookie_domain = .test.com;
session.cookie_lifetime = 1800;
3、在程序入口文件且在session_start()之前,设置:
session_set_cookie_params(1800 , ‘/’, ‘.test.com’);
这样在同一台服务器上多个子域名共享session的问题就解决了!

那么,如果子域名放在不同的服务上呢?这个时候我们发现session默认是以文件的形式储存到服务器上的,现在程序都分别放在两台服务器上去了,还怎么共享呢?解决办法是改变session默认的储存
方式。本文以memcache为例(当然也可以使用数据库来存储),将session信息都储存到memcache中,两个应用都到memcache中去存取session信息,同样使用3种方式:
1、php.ini中设置:
session.save_handler = memcache
session.save_path = “tcp://192.168.1.100:11211″
session.cookie_domain = ‘.test.com’
2、某个目录下的 .htaccess
php_value session.save_handler “memcache”
php_value session.save_path “tcp://192.168.1.100:11211″
php_value session.cookie_domain “.test.com”
3、在程序入口文件且在session_start()之前,设置:
ini_set(“session.save_handler”, “memcache”);
ini_set(“session.save_path”, “tcp://192.168.1.100:11211″);
ini_set(‘session.cookie_domain’, ‘.test.com’);

ini_set(“session.save_handler”, “memcached”); // 是memcached不是memcache
ini_set(“session.save_path”, “192.168.1.100:11211″); // 不要tcp

192.168.1.100代表memcache服务器ip地址,根据实际情况换成自己的ip,除了以上的方式还可以自己写一个处理类通过函数session_set_save_handler来处理session的存取问题。

windows php memcached 安装使用步骤

本文以php5.3为例:

1、下载文件包memcache(php5.3.28)

2、解压到:d:\memcached

3、在终端(也即cmd命令界面)下输入 ‘d:\memcached\memcached.exe -d install’ 安装

4、再输入: ‘d:\memcached\memcached.exe -d start’ 启动。(需要注意的: 以后memcached将作为windows的一个服务每次开机时自动启动。这样服务器端已经安装完毕了)

5、拷贝php_memcache.dll到php的ext文件夹下

6、php.ini 加入一行 ‘extension=php_memcache.dll’

7、接着在 php.ini 文件里加上:

[php][Memcache]<br />
memcache.allow_failover = 1<br />
memcache.max_failover_attempts=20<br />
memcache.chunk_size =8192<br />
memcache.default_port = 11211 [/php]

常用设置:
-p <num>          监听的端口
-l <ip_addr>      连接的IP地址, 默认是本机
-d start          启动memcached服务
-d restart        重起memcached服务
-d stop|shutdown  关闭正在运行的memcached服务
-d install        安装memcached服务
-d uninstall      卸载memcached服务
-u <username>     以<username>的身份运行 (仅在以root运行的时候有效)
-m <num>          最大内存使用,单位MB。默认64MB
-M                内存耗尽时返回错误,而不是删除项
-c <num>          最大同时连接数,默认是1024
-f <factor>       块大小增长因子,默认是1.25
-n <bytes>        最小分配空间,key+value+flags默认是48
-h                显示帮助

php扩展apc的安装和配置

一、linux
1,下载APC

wget http://pecl.php.net/get/APC-3.1.9.tgz

2,解压和编译

tar zxvf APC-3.1.9.tgz
cd APC-3.1.9
/usr/local/php/bin/phpize
./configure –enable-apc –enable-apc-mmap –enable-apc-spinlocks –disable-apc-pthreadmutex –with-php-config=/usr/local/php/bin/php-config
make
make install
make clean

3,编辑php.ini

找到 extension_dir ,把值改为/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/,然后在下面加入

extension=apc.so
apc.enabled = 1
apc.shm_size = 64M
apc.stat = 1

其中apc.shm_size设置的是内存大小,一般用64M即可,小内存的可以改为32M。
apc.stat设置成0的话,性能会更好一点,但是设置成0后,修改了PHP文件后必须得重启下PHP才能马上更新内容。
对于平时修改比较多的站点来说,还是设置成1比较好。

4,重启PHP即可生效。

二、windows

1、下载php_apc.dll http://downloads.php.net/pierre/ 或者 http://pecl.php.net/package/APC/3.1.13/windows

2、将php_apc.dll 复制到 php 的ext目录下,修改php.ini文件 增加 extension=php_apc.dll,尾部增加

[apc]

apc.enabled = 1

apc.shm_segments = 1

apc.shm_size = 64

apc.optimization = 0

apc.num_files_hint = 1000

apc.ttl = 0

apc.gc_ttl = 3600

apc.cache_by_default = On

apc.slam_defense = 0

apc.file_update_protection = 2

apc.enable_cli = 0

apc.stat=0 #(是否启用脚本更新检查。 改变这个指令值要非常小心。 默认值 On 表示APC在每次请求脚本时都检查脚本是否被更新, 如果被更新则自动重新编译和缓存编译后的内容。但这样做对性能有不利影响。 如果设为 Off 则表示不进行检查,从而使性能得到大幅提高。)

3、重新启动apache

配置详解:http://www.php.net/manual/zh/apc.configuration.php

PHP中ts和nts版本,vc6和vc9编译版本的区别

VC6:legacy Visual Studio 6 compiler,就是使用这个编译器编译的。
VC9:Visual Studio 2008 compiler,就是用微软的VS编辑器编译的。
由于apache.org只提供VC6的版本,所以使用原版apache时只能使用VC6。(www.apachelounge.com上有apache VC9的版本提供,应该可以和PHP VC9配合,没用过)
TS:Thread Safe 线程安全, 执行时会进行线程(Thread)安全检查,以防止有新要求就启动新线程的CGI执行方式而耗尽系统资源
NTS:Non Thread Safe 非线程安全, 在执行时不进行线程(Thread)安全检查
PHP的两种执行方式:ISAPI和FastCGI。
ISAPI(Internet Server Application Programming Interface)执行方式是以DLL动态库的形式使用,可以在被用户请求后执行,在处理完一个用户请求后不会马上消失,所以需要进行线程安全检查,这样来提高程序的执行效率,所以如果是以ISAPI来执行PHP,建议选择Thread Safe版本
apache中的配置方式:

#下面这个是加载TS版本的php必须的
LoadModule php5_module “xxx/php5apache2_2.dll”
#下面这行可有可无

AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt
FastCGI执行方式是以单一线程来执行操作,所以不需要进行线程的安全检查,除去线程安全检查的防护反而可以提高执行效率,所以,如果是以FastCGI来执行PHP,建议选择Non Thread Safe版本。
apache中的配置方式:

#下面这两行是加载NTS版本的php必须的,不可以直接写成Action application/x-httpd-php “c:/wamp/bin/php/php3.5.6/php-cgi.exe”!
ScriptAlias /php/ “C:/wamp/bin/php/php3.5.6/”
Action application/x-httpd-php “/php/php-cgi.exe”

#另外,还要有之前的AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml .phpt,这样才能认识php格式的文件

#这样配置完可能还会因为权限问题而无法用php-cgi.exe解析php网页,所以还要加上下面这段

<Directory “C:/wamp/bin/php/php5.3.6/”>
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
官方并不建议你将Non Thread Safe 应用于生产环境,所以我们选择Thread Safe 版本的PHP来使用。
XAMPP在http-xampp.conf中默认配置是使用ISAPI的方式

各大开放平台的OAuth 2.0授权汇总

新浪微博帐号登录: http://open.weibo.com/wiki/授权机制说明
腾讯QQ登录: http://wiki.opensns.qq.com/wiki/【QQ登录】Qzone_OAuth2.0简介
淘宝帐号登录: http://open.taobao.com/doc/detail.htm?id=118
百度帐号登录: http://dev.baidu.com/wiki/connect/index.php?title=百度OAuth2.0官方参考文档
人人网帐号登录: http://dev.xiaonei.com/wiki/Authentication

wordpress更换域名需要进行的操作

第一步:修改数据库配置文件,如果你在同一主机同一空间上更改域名,这步可以省掉,如果数据库不同,还得要打开wp-config.php将数据库配置正确才可以正常访问新域名。

第二步:更改博客的安装地址和博客地址,首先用phpmyadmin打开你的数据库,然后找到wp-options这个数据表,找到第一条记录也就是siteurl这条,还有第39条home,这两条将地址改成你更换后的最域名即可。只有完成这一步后,才可以顺利进入后台,否则即使你输入密码,也会自动跳转到原来的老域名。PHP My管理中选择数据库,—->点击 SQL 在输入栏中输入如下代码:
UPDATE wp_options SET option_value = replace( option_value, ‘http://老域名’, ’http://新域名’) WHERE option_name = ‘home’ OR option_name =’siteurl’ ;

第三步:修改文章内部所有的链接为新域名,相信大家在以前发表的文章中一定加了不少内链吧,域名更换了,老的内链也就没有意义了。此时得要将文章内链的旧域名修改为新域名。如果从后台文章编辑里一个一个找那是不现实的,方法有一个,通用phpmyadmin进入你所在的数据库,执行以下语句就可以把文章内的所有内链旧域名批量改为新域名:
UPDATE wp_posts SET post_content = replace(post_content, ‘http://老域名’, ‘http://新域名’);
UPDATE wp_posts SET guid = replace( guid, ‘http://老域名’ , ’http://新域名’ ) ;

修改完成!

修改phpmyadmin登陆超时的时间限制

找到配置文件:

\phpMyAdmin\libraries\config.default.php

将:$cfg[‘LoginCookieValidity’] = 1800; // 以秒计,默认为3分(1800秒)。

改:$cfg[‘LoginCookieValidity’] = 36000; // 10个小时