Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在共享主机服务器上上载wesbite时出现500内部错误_Php_Laravel - Fatal编程技术网

Php 在共享主机服务器上上载wesbite时出现500内部错误

Php 在共享主机服务器上上载wesbite时出现500内部错误,php,laravel,Php,Laravel,我在laravel框架中创建了一个网站,该网站在本地服务器上运行良好,因此我开始将其上传到服务器上。首先,我创建了一个zip文件,其中包含除公共文件以外的所有文件,并将其上传到名为“laravel”的文件夹中,我在我的cpanel的主目录中制作了该文件夹并提取了内容。之后,我制作了一个public压缩包,并将该压缩包上传到public_html文件夹中并解压缩。然后,我将index.php编辑为/./bootstrap/to/./laravel/bootstrap,并将其保存在两个位置。之后,我

我在laravel框架中创建了一个网站,该网站在本地服务器上运行良好,因此我开始将其上传到服务器上。首先,我创建了一个zip文件,其中包含除公共文件以外的所有文件,并将其上传到名为“laravel”的文件夹中,我在我的cpanel的主目录中制作了该文件夹并提取了内容。之后,我制作了一个public压缩包,并将该压缩包上传到public_html文件夹中并解压缩。然后,我将index.php编辑为/./bootstrap/to/./laravel/bootstrap,并将其保存在两个位置。之后,我将其转储数据库和did成功地在.env文件中进行了更改。问题是,现在有500个内部服务器错误

Internal Server Error

The server encountered an internal error or misconfiguration and was                   unable to complete your request.

 Please contact the server administrator at webmaster@tncpscouriers.com       to inform them of the time this error occurred, and the actions you performed just before this error.

 More information about this error may be available in the server error log.

 Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
最初有一个单页的静态网站,所以我想更改te index.php以将其重新带回来,但它仍然不起作用。我现在不知道,今天是我将项目移交给客户的最后期限 我的.htaccess文件是

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

选项-多视图
重新启动发动机
#如果不是文件夹,则重定向尾部斜杠。。。
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
#句柄授权头
RewriteCond%{HTTP:Authorization}。
重写规则。*-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]

检查文件夹中是否有
.env
文件

如果没有:

生成您的
.env

cp .env.example .env
生成您的密钥:

php artisan key:generate
然后,为您的laravel文件夹授予正确的权限

进入laravel项目

cd my_project_folder
将644权限添加到文件,将755权限添加到文件夹:

find ./ -type f -exec chmod 644 {} \;
find ./ -type d -exec chmod 755 {} \;
如果出现其他错误,请尝试更新编写器

composer update

彻底检查服务器错误日志和
/storage/logs
中的任何日志,它将为您提供出现500错误的原因。500错误本身太大,无法排除故障。在我的cpanel中,我转到了矩阵标题中的错误。在应用程序中有错误列表
5:08.076146 2017][:error][pid 12349][client 49.202.144.203:46977]SoftException.cpp:651:Directory”/home/tncpscouriers/public_html”可按组写入
chmod
public\u html
和子文件夹写入
755
chmod-R 755 public\u html
。另外,查找
.htaccess
的问题我会查找比SoftExceptions更严重的致命错误我被权限错误搞得一团糟,所以我错误地将其更改为000 plz帮助我不,我能做什么???您删除了权限,如果它只在您的laravel文件夹上,请尝试删除整个文件夹,再次添加并添加权限。如果您在所有共享服务器中执行此操作,可能需要与主机联系以重置服务器。实际上,我是在显示错误的公用文件夹中执行此操作的,public_html可由groupjoao mantovani编写实际上我使用的是gui,没有提供终端。因此我不知道如何通过命令行执行所有这些操作。是的,我有.env文件,权限是我在这里最头疼的问题。因为即使我将权限更改为622644755,仍然存在错误,而且我认为644正在运行因为这给了组写权限,所以我认为622是正确的,但仍然显示错误。