簡體   English   中英

yii2前端和后端在共享服務器上不起作用

[英]yii2 frontend and backend not working on shared server

我們在yii2中建立了一個項目。 在本地服務器上工作正常。 但是它不能在共享服務器上工作。 我在htaccess中嘗試了很多,但仍然無法為我工作,這給了我500個內部服務器錯誤

前端htaccess:

RewriteEngine on

# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php

后端htaccess

RewriteEngine on

# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php

我怎么解決這個問題 ?

服務器可能不支持16位.php文件。 當您將文件另存為UTF-8時,某些編輯器(例如Windows上的記事本)將始終添加字節順序標記(BOM),因此請確保使用文本編輯器來保存不帶BOM的文件。 我遇到了完全相同的問題,並且花了我很多時間來調試問題,因為兩種格式的文本在查看時看起來都相同。 使用session_start()時,問題非常棘手,因為文件必須以

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM