2017-10-05 17 views
0

對不起,但我忘記了這裏的基礎知識。codeigniter項目不使用wampserver在localhost中加載

我有我的codeigniter項目,我使用wamp在localhost中設置它。

數據庫設置已正確設置。

這是我對codeigniter的設置;

application/config

switch(ENVIRONMENT) { 
    case 'development' : $config['base_url'] = 'http://localhost:8080/'; break; 
    case 'testing':   $config['base_url'] = 'http://160.16.204.159/'; break; 
    case 'production':  $config['base_url'] = 'http://system.bnb-brams.com/'; break; 
} 

application/public/index.php

define('ENVIRONMENT', 'development'); 

然後在我的Apache的httpd.conf這是設置;

Listen 0.0.0.0:80 
Listen [::0]:80 

and 

ServerName localhost:80 

所有的服務都運行在wamp上。

當我在chrome瀏覽器上加載它時,輸入​​,它說:

This site can’t be reached 

localhost refused to connect. 
     Did you mean http://localhost-8080.com/? 
     Search Google for localhost 8080 
ERR_CONNECTION_REFUSED 

我完全忘了如何在codeigniter和wamp中設置一些東西,我需要幫助。

回答

0

Apache的似乎不被監聽的端口8080,只需80

添加

Listen 0.0.0.0:8080 

或改變它在第一次聽的線。

+0

從codeigniter配置行刪除端口號會更簡單! – RiggsFolly

+0

取決於本地配置。我認爲他和我的情況是一樣的,我有80端口的IIS監聽和8080端口的WAMP監聽 – Tk42421

0

Apache是​​端口80,而不是8080端口監聽,你從你的httpd.conf

Listen 0.0.0.0:80 
Listen [::0]:80 

告訴我們這樣改變這一行使用端口80,而不是8080端口。事實上,如果它的端口80上你不需要使用此線路上的端口,因爲80始終是Web服務器的默認端口。

case 'development' : $config['base_url'] = 'http://localhost/'; break; 
相關問題