在实时服务器上部署项目时出现404错误。我在laravel页面上说Sorry, the page you are looking for could not be found.
,所以我知道它正在到达我的项目。
我分别运行php artisan config:cache
和php artisan route:cache
来注册我的路线和缓存,但是它仍然没有改变。不太确定为什么会收到此错误。我在vhost中的文档根目录也设置为我的公用文件夹。
我部署的步骤
777
的权限(我只是想让它部署并查看它是否存在错误,所以我知道它是错的)project/public
虚拟主机
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/html/API/public
#DocumentRoot /var/www/API/public/
ServerName api.app.io
ServerAlias api.app.io
ErrorLog ${APACHE_LOG_DIR}/api-error.log
CustomLog ${APACHE_LOG_DIR}/api-access.log combined
<Directory "/var/www/API/public">
#Options +Includes
#Options +FollowSymLinks -Indexes
Options All
AllowOverride All
Require all granted
</Directory>
SSLCertificateFile /etc/letsencrypt/live/api.app.io/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/api.app.io/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/api.app.io/chain.pem
</VirtualHost>
</IfModule>
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
# RewriteCond %{HTTP:Authorization} .
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handles JWT middleware
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
</IfModule>
答案 0 :(得分:0)
尝试在托管面板中更改php版本。