2016-12-17 48 views
0

我想從bigcommerce/hello-world-app-php-silex安裝BigCommerce Hello World App。當我嘗試在我的試用商店中安裝應用程序時,它顯示應用程序文件夾的索引。 Index of the app folderBigCommerce - Hello World App - 回撥URL

我認爲這與回調網址有關。 Callback URLs

的說明是不明確的東西進入這裏,所以我進入:

index.php is位於bigcommerce/hello-world-app-php-silex

我應該爲回調URL輸入什麼內容?

此外,這是我在環境變量的.env文件中輸入的內容。
BC_AUTH_SERVICE和BC_CALLBACK_URL environment variables

更新:好吧,我能得到的index.php默認加載。
在Apache24/conf/httpd.conf中,我將「AllowOverride None」更改爲「AllowOverride FileInfo」,取消了「LoadModule rewrite_module modules/mod_rewrite.so」的註釋,並在項目根目錄下的.htaccess文件中, 「/」進行index.php所以它現在說「RewriteRule ^(。*)$ index.php/$ 1 [L]」。因爲項目不在根目錄中,所以需要刪除「/」。

現在我得到兩個錯誤。它看起來像這個項目被寫入根目錄,所以我把它放在根目錄中,把「/」放回到.htaccess中,更新了URL,並且我仍然得到相同的兩個錯誤。

ResourceNotFoundException

NotFoundHttpException

+0

爲什麼懷疑回調網址是問題的原因是什麼?問題在於您的Web服務器未配置爲執行PHP文件。無論如何,您需要用服務器的DNS名稱或IP地址替換localhost,以便客戶端可以訪問它。 – CodeCaster

+0

@CodeCaster我測試了一個使用捲髮驗證的測試.php文件的Web服務器,所以我知道它的工作原理。另外,我正嘗試將它安裝在我的試用商店中,從我的計算機安裝,我的Web服務器已設置好,localhost工作正常。 – Matt

+1

您看到包含'index.php'文件的目錄列表的事實證明,您的Web服務器(至少在此目錄中)未設置爲執行PHP文件。 – CodeCaster

回答

0

在你的項目根目錄下添加的.htaccess與此代碼

RewriteEngine on 
#RewriteBase/

# only rewrite if the requested file doesn't exist 
RewriteCond %{REQUEST_FILENAME} !-s 

# pass the rest of the request into index.php to handle 
RewriteRule ^(.*)$ /index.php/$1 [L] 

# Prevent the web from seeing the readme.md just to be safe 
RewriteRule ^README\.MD$ - [L,F] 
+0

不要轉儲代碼。解釋OP的問題並解釋你的答案如何解決這個問題。 – CodeCaster

+1

根目錄中有一個.htaccess文件,其中包含該確切內容。 – Matt

0

我會這麼多次我會利用一切可能性,但錯誤沒有解決,讓我知道你在你的情況下解決這個錯誤。

https://i.stack.imgur.com/9nLKu.jpg

Here My .env file : 
BC_AUTH_SERVICE=https://login.bigcommerce.com 
BC_CLIENT_ID=My client id 
BC_CLIENT_SECRET=My secret id 
BC_CALLBACK_URL=https://localhost/bigcommerce/callback/load 

Here My Server path in dev tools file: 
Auth Callback URL - more info 
https://localhost/bigcommerce/callback 
Load Callback URL - more info 
https://localhost/bigcommerce/load 
Uninstall Callback URL - more info 
https:/localhost/bigcommerce/uninstall 

Let me folder structure of Silex 
My localhost is Right now [ HTTPS ] : https://localhost/bigcommerce/index.php