Zend Framework 項目 index.php 的問題

來源:互聯網
上載者:User

標籤:public   解決   error   檔案   conf   靜態   zend   無法   自動   

預設產生的Zend項目在public目錄下會自動產生一個.htaccess檔案,這是用來實現偽靜態,即隱藏index.php這個唯一入口檔案的。

但是,搭建項目時遇到一個問題:URL中如果不加index.php就無法訪問,加了index.php就可以訪問。

查看apache的error.log,發現這個錯誤:

  [Wed Nov 16 20:09:27.068594 2016] [negotiation:error] [pid 6628] [client 127.0.0.1:57786] AH00687: Negotiation: discovered file(s) matching request: /home/username/projects/projectsname/public/index (None could be negotiated).

解決:可能是 negotiation 模組的問題,開啟 /etc/apach2/mods-avaliable/negotiation.conf

把裡面一行 LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so 注釋掉就行了,

這個問題跟這個模組有關,具體原因我也不清楚。

Zend Framework 項目 index.php 的問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.