2016-11-05 73 views
1

當我嘗試做一個作曲家的更新,它出現以下消息:「致命錯誤無法連接到基址」 我使用symfony的3致命錯誤無法連接到基址

我希望你可以幫助我。由於

Error image

+0

如果你嘗試'php作曲者更新'這是否有所作爲? –

+0

Hi @Alvin,no。隨着PHP作曲家更新,發生相同。 –

+0

看起來像你正在使用xampp。你可以嘗試停止Apache,然後做'作曲者更新'?看看這是否有所作爲? –

回答

0

既然你有XAMPP,這樣做:

  1. 停止Apache。
  2. 運行composer update

這應該修復它!

namespace AppBundle\Controller; 

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 
use Symfony\Bundle\FrameworkBundle\Controller\Controller; 
use Symfony\Component\HttpFoundation\Request; 

class DefaultController extends Controller 
{ 
    /** 
    * @Route("/", name="homepage") 
    */ 
    public function indexAction(Request $request) 
    { 

     return $this->render('default/index.html.twig', [ 
      'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR, 
     ]); 
    } 
} 

到:

0

例如,在你的appbundle /的Controler/DefaultController

剛從刪除陣列通過

參數

namespace AppBundle\Controller; 

...所有使用說明

class DefaultController extends Controller 
{ 
    /** 
    * @Route("/", name="homepage") 
    */ 
    public function indexAction(Request $request) 
    { 

     return $this->render('default/index.html.twig', [ 

     ]); 
    } 
} 
0

解決錯誤只是停止你的apache服務器並運行作曲家更新並再次啓動Apache服務器和錯誤消失。我相信這會幫助你

相關問題