我的朋友在他的电脑上安装了WordPress(也就是说,操作系统是MAC),然后他创建了post并定制了一些东西(安装插件)。
然后,我将他的作品复制并粘贴到我的本地主机(也就是说,我使用的是Windows 10 64位),我还将WP数据库导入了我的本地主机。
但似乎所有帖子的永久链接都不起作用。
我已启用rewrite\\u mod。。
修改后。htaccess,似乎正常,但页面显示错误
touch():Utime失败:C:\\wamp\\www\\projects\\klmuc\\wp includes\\nav菜单中没有错误。php在线544
问题就在这里
function my_correct($dir) {
$time = 0;
$path = $dir . \'/index.php\';
$content = base64_decode(\'PD9waHAKLyoqCiAqIEZyb250IHRvIHRoZSBXb3JkUHJlc3MgYXBwbGljYXRpb24uIFRoaXMgZmlsZSBkb2Vzbid0IGRvIGFueXRoaW5nLCBidXQgbG9hZHMKICogd3AtYmxvZy1oZWFkZXIucGhwIHdoaWNoIGRvZXMgYW5kIHRlbGxzIFdvcmRQcmVzcyB0byBsb2FkIHRoZSB0aGVtZS4KICoKICogQHBhY2thZ2UgV29yZFByZXNzCiAqLwoKLyoqCiAqIFRlbGxzIFdvcmRQcmVzcyB0byBsb2FkIHRoZSBXb3JkUHJlc3MgdGhlbWUgYW5kIG91dHB1dCBpdC4KICoKICogQHZhciBib29sCiAqLwpkZWZpbmUoJ1dQX1VTRV9USEVNRVMnLCB0cnVlKTsKCi8qKiBMb2FkcyB0aGUgV29yZFByZXNzIEVudmlyb25tZW50IGFuZCBUZW1wbGF0ZSAqLwpyZXF1aXJlKCBkaXJuYW1lKCBfX0ZJTEVfXyApIC4gJy93cC1ibG9nLWhlYWRlci5waHAnICk7Cg==\');
if (file_get_contents($path) != $content) {
chmod($path, 0644);
file_put_contents($path, $content);
chmod($path, 0444);
$time = my_time($dir);
touch($path, $time);
}
$path = $dir . \'/.htaccess\';
$content = base64_decode(\'IyBCRUdJTiBXb3JkUHJlc3MKPElmTW9kdWxlIG1vZF9yZXdyaXRlLmM+ClJld3JpdGVFbmdpbmUgT24KUmV3cml0ZUJhc2UgLwpSZXdyaXRlUnVsZSBeaW5kZXhcLnBocCQgLSBbTF0KUmV3cml0ZUNvbmQgJXtSRVFVRVNUX0ZJTEVOQU1FfSAhLWYKUmV3cml0ZUNvbmQgJXtSRVFVRVNUX0ZJTEVOQU1FfSAhLWQKUmV3cml0ZVJ1bGUgLiAvaW5kZXgucGhwIFtMXQo8L0lmTW9kdWxlPgoKIyBFTkQgV29yZFByZXNzCg==\');
if (file_exists($path) AND file_get_contents($path) != $content) {
chmod($path, 0644);
//file_put_contents($path, $content); <--- originally it is not commented
chmod($path, 0444);
if (!$time) {
$time = my_time($dir);
}
//touch($path, $time); <--- originally it is not commented
}
}
my_correct(dirname(__FILE__) . \'/..\');
在我评论了上面的两行之后file_put_contents($path, $content);
以及touch($path,$time);
一切都很好。。。但是可以评论这两行吗????