简体   繁体   English

无法在共享主机中安装流明

[英]Can't install lumen in shared hosting

I am trying to install latest lumen in my shared hosting. 我正在尝试在共享主机中安装最新的流明。 I have created a folder named lumen in public_html and placed all the files in that folder. 我在public_html中创建了一个名为lumen的文件夹,并将所有文件放在该文件夹中。 When I browse the url, for example: https://example.com/lumen it gives me 500 error code. 当我浏览URL时,例如: https : //example.com/lumen,它给了我500错误代码。

The same code is running fine in localhost. 相同的代码在localhost中运行良好。 When I upload it in my shared hosting it stops working. 当我将其上传到共享主机中时,它将停止工作。 I have added a new .htaccess in the root of lumen folder including this code: 我在lumen文件夹的根目录中添加了一个新的.htaccess ,包括以下代码:

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]

Also tried to edit the .htaccess file of public folder as well, and also the index.php , but nothings work. 还尝试编辑公用文件夹的.htaccess文件以及index.php ,但没有任何效果。

I couldn't find any appropriate result about this problem. 我找不到有关此问题的任何适当结果。 All I can find is about laravel. 我所能找到的只是关于laravel。 Can anyone help me with this? 谁能帮我这个? The error log of public folder is included: 公用文件夹的错误日志包括:

[25-Oct-2018 06:54:54 UTC] PHP Parse error: syntax error, unexpected '=' in /home2/lilyserv/public_html/lumen/vendor/illuminate/config/Repository.php on line 6 8 [25-Oct-2018 06:54:54 UTC] PHP Parse error: syntax error, unexpected '=' in /home2/lilyserv/public_html/lumen/vendor/illuminate/config/Repository.php on line 6 8

Are you sure it's lumen 5.4? 您确定它的流明5.4吗? Because there is nothing on that line here: 因为这里没有任何内容:

https://github.com/laravel/framework/blob/5.4/src/Illuminate/Config/Repository.php#L68 https://github.com/laravel/framework/blob/5.4/src/Illuminate/Config/Repository.php#L68

But there is something here: https://github.com/laravel/framework/blob/5.7/src/Illuminate/Config/Repository.php#L68 但是这里有一些东西: https : //github.com/laravel/framework/blob/5.7/src/Illuminate/Config/Repository.php#L68

This is 5.7 version. 这是5.7版本。


What you can do: 你可以做什么:

  1. Check exactly what Lumen version you have and try to install the propper Lumen 5.4 version. 确切检查您拥有的流明版本,然后尝试安装适当的流明5.4版本。
  2. If you want to have the Lumen 5.7 version(latest) check your PHP version. 如果您想拥有Lumen 5.7版本(最新),请检查您的PHP版本。 You need PHP 7+ to run newer versions of Lumen. 您需要PHP 7+才能运行更新版本的Lumen。 I think you have PHP 5 or something. 我认为您有PHP 5之类的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM