歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 19, 2024, 09:17:24 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  開發  |  外掛程式  |  在 DreamHost 安裝 Sitemap plugin « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 在 DreamHost 安裝 Sitemap plugin  (閱讀 22450 次)
evenrain
初級會員
**
文章: 98



檢視個人資料
« 於: 九月 20, 2006, 10:36:03 上午 »

昨天試著裝了 1.1 版的 sitemap plugin,
發現由於 Dreamhost 不支援 fopen,所以會造成錯訊息
稍微 Google 了一下,找到了解法 (可能之前論壇有人發表過了,不過我沒找著,重複就....XD)

1. 打開 pluginsitemap.class.php
2. 尋找
程式碼:
$pingUrl = "http://www.google.com/webmasters/sitemaps/ping?sitemap=" . urlencode($rewriteFileUrl);
3. 將
程式碼:
                $handle = fopen( $pingUrl, "r" );
                fclose( $handle );

改為

程式碼:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $pingUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);

即可
已記錄
lss
我不是被~拉~~出來的,不要叫我大大!
總版主
超級會員
*****
文章: 1511



檢視個人資料 個人網站
« 回覆文章 #1 於: 九月 20, 2006, 10:56:26 上午 »

 Dreamhost 不可能不支援 fopen ,可能是把 allow_url_fopen 功能關掉了,請參考這裡: http://www.php.net/manual/en/ref.filesystem.php

另外,你的改法不見得適用於每個人,因為不一定所以的主機的 PHP 都有 CURL 支援 (參考這裡: http://www.php.net/manual/en/ref.curl.php ) ,要這樣改的人得注意一下。

lss
已記錄

沒找過 常見問題集或不知道 如何在 LifeType 中文開發論壇發問的人,恕不回答問題
fishbudinli
新手見習
*
文章: 12


檢視個人資料
« 回覆文章 #2 於: 十一月 02, 2006, 10:42:31 上午 »

請問一下我試著裝sitemap的plugin,不過可能是因為網址的表現方式的關係,所以好像沒辦法成功的找到sitemap的檔案
這是plugin建議的網址
http://localhost/lifetype/index.php?blogId=1/sitemap1.gz
因為我沒辦法在我的虛擬主機上用簡潔的網址
有其他的方法嗎?
(我適用1.1.1版的)

« 最後編輯時間: 十一月 02, 2006, 10:48:59 上午 由 fishbudin » 已記錄
ROCK
新手見習
*
文章: 7



檢視個人資料 個人網站
« 回覆文章 #3 於: 十一月 02, 2006, 09:46:45 下午 »

請問一下我試著裝sitemap的plugin,不過可能是因為網址的表現方式的關係,所以好像沒辦法成功的找到sitemap的檔案


我也遇到了這個問題.可以請高手指點一下嗎?
謝謝
已記錄
evenrain
初級會員
**
文章: 98



檢視個人資料
« 回覆文章 #4 於: 十一月 03, 2006, 10:16:26 上午 »

請問一下我試著裝sitemap的plugin,不過可能是因為網址的表現方式的關係,所以好像沒辦法成功的找到sitemap的檔案
這是plugin建議的網址
http://localhost/lifetype/index.php?blogId=1/sitemap1.gz
因為我沒辦法在我的虛擬主機上用簡潔的網址
有其他的方法嗎?
(我適用1.1.1版的)



直接改成
http://localhost/lifetype/sitemap1.gz
已記錄
fishbudinli
新手見習
*
文章: 12


檢視個人資料
« 回覆文章 #5 於: 十一月 03, 2006, 10:33:58 上午 »


我試過但是也是不行 請問這是確定可以的方法嗎?
還是我需要再修改其他地方? (正在研究 code 中 ... 嚎啕大哭 )
已記錄
evenrain
初級會員
**
文章: 98



檢視個人資料
« 回覆文章 #6 於: 十一月 03, 2006, 11:27:53 上午 »


我試過但是也是不行 請問這是確定可以的方法嗎?
還是我需要再修改其他地方? (正在研究 code 中 ... 嚎啕大哭 )

1. 先確認 /tmp/sitemap/your_blog_id 裡有沒有 sitemap.gz 這個檔
2. /tmp/.htaccess 的相關修改改了沒?
程式碼:
<Files "sitemap.gz">
 Allow from all
</Files>
已記錄
fishbudinli
新手見習
*
文章: 12


檢視個人資料
« 回覆文章 #7 於: 十一月 03, 2006, 12:01:13 下午 »


我試過但是也是不行 請問這是確定可以的方法嗎?
還是我需要再修改其他地方? (正在研究 code 中 ... 嚎啕大哭 )

1. 先確認 /tmp/sitemap/your_blog_id 裡有沒有 sitemap.gz 這個檔
2. /tmp/.htaccess 的相關修改改了沒?
程式碼:
<Files "sitemap.gz">
 Allow from all
</Files>

1. sitemap.gz 並沒有在我的 /tmp/sitemap/1/下面。就算我手動加入他還是會出現錯誤。要怎麼讓他自動出現呢?
當我輸入 http://localhost/lifetype/sitemap1.gz 的時候,他出現找不到的錯誤:
The requested URL /tmp/sitemap/1/sitemap.gz was not found on this server.

2. 我的/tmp/.htaccess 的內容
<Files "*">
 Order deny,allow
 Deny from all
</Files>

<Files "sitemap.gz">
 Allow from all
</Files>

已記錄
evenrain
初級會員
**
文章: 98



檢視個人資料
« 回覆文章 #8 於: 十一月 03, 2006, 01:51:21 下午 »

1. sitemap.gz 並沒有在我的 /tmp/sitemap/1/下面。就算我手動加入他還是會出現錯誤。要怎麼讓他自動出現呢?
當我輸入 http://localhost/lifetype/sitemap1.gz 的時候,他出現找不到的錯誤:
The requested URL /tmp/sitemap/1/sitemap.gz was not found on this server.

確認相關目錄是否已開為可寫入
已記錄
fishbudinli
新手見習
*
文章: 12


檢視個人資料
« 回覆文章 #9 於: 十一月 03, 2006, 02:37:32 下午 »

1. sitemap.gz 並沒有在我的 /tmp/sitemap/1/下面。就算我手動加入他還是會出現錯誤。要怎麼讓他自動出現呢?
當我輸入 http://localhost/lifetype/sitemap1.gz 的時候,他出現找不到的錯誤:
The requested URL /tmp/sitemap/1/sitemap.gz was not found on this server.

確認相關目錄是否已開為可寫入

我現在是用 Lifetype ToGo 在本機上先測試
是Windows作業系統 這樣會有權限問題嗎?因為其他的 cache也可以在這裡寫入
當我照他的指到
http://localhost/lifetype/index.php?blogId=1/sitemap1.gz
的時候,\tmp\sitemap\1\ 就會被建出來 不過sitemap.gz並不存在
不過頁面會被帶到首頁 並不會出現問題
« 最後編輯時間: 十一月 03, 2006, 02:42:50 下午 由 fishbudin » 已記錄
ROCK
新手見習
*
文章: 7



檢視個人資料 個人網站
« 回覆文章 #10 於: 十一月 03, 2006, 07:32:29 下午 »

我成功了   開懷大笑

我是少做了這一項

Add the following lines to the plog/.htaccess

<IfModule mod_rewrite.c>
 
RewriteEngine On

RewriteBase /

# Point to the sitemap file that is local to the blog
RewriteRule     ^sitemap([0-9]+)\.gz$ tmp/sitemap/$1/sitemap.gz [L,NC]

</IfModule>
已記錄
fishbudinli
新手見習
*
文章: 12


檢視個人資料
« 回覆文章 #11 於: 十一月 03, 2006, 08:55:48 下午 »

我成功了   開懷大笑

我是少做了這一項

Add the following lines to the plog/.htaccess

<IfModule mod_rewrite.c>
 
RewriteEngine On

RewriteBase /

# Point to the sitemap file that is local to the blog
RewriteRule     ^sitemap([0-9]+)\.gz$ tmp/sitemap/$1/sitemap.gz [L,NC]

</IfModule>


我還是不行
請問你 /tmp/sitemap/1 底下有 sitemap.gz 嗎?要怎樣才會才被建出來?
已記錄
ROCK
新手見習
*
文章: 7



檢視個人資料 個人網站
« 回覆文章 #12 於: 十一月 04, 2006, 09:41:26 上午 »

[我還是不行
請問你 /tmp/sitemap/1 底下有 sitemap.gz 嗎?要怎樣才會才被建出來?
/tmp/sitemap/1 底下有 sitemap.gz
啟動外掛應該就可以了.我沒做其他設定
已記錄
頁: [1]
LifeType 中文開發論壇  |  開發  |  外掛程式  |  在 DreamHost 安裝 Sitemap plugin « 上篇主題 下篇主題 »
    前往: