服务器错误 500。在本地灯服务器上安装 Ospos 时

服务器错误 500。在本地灯服务器上安装 Ospos 时

我尝试安装时收到服务器错误 500开源pos在我的 ubuntu 上的本地 lamb 服务器上。我附上了错误输出。我将附上我所做更改的屏幕截图。请帮我找出导致错误的原因。它与其他 PHP 文件配合得很好。错误 500

这是我保存在 html 文件夹中的 .htaccess 文件

# redirect to public page
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^public$
RewriteRule ^(.*)$ %{REQUEST_URI}public/ [R=301,L]
</IfModule>

# disable directory browsing
# For security reasons, Option all cannot be overridden.
Options +ExecCGI +Includes +IncludesNOEXEC +SymLinksIfOwnerMatch -
Indexes

# prevent folder listing
IndexIgnore *

# Apache 2.4
<IfModule authz_core_module>
# secure htaccess file
<Files .htaccess>
Require all denied
</Files>

# prevent access to PHP error log
<Files error_log>
Require all denied
</Files>

# prevent access to LICENSE
<Files LICENSE>
Require all denied
</Files>

# prevent access to csv, txt and md files
<FilesMatch "\.(csv|txt|md|yml|json|lock)$">
Require all denied
</FilesMatch>
</IfModule>

# Apache 2.2
<IfModule !authz_core_module>
# secure htaccess file
<Files .htaccess>
Order allow,deny
Deny from all
Satisfy all
</Files>

# prevent access to PHP error log
<Files error_log>
Order allow,deny
Deny from all
Satisfy all
</Files>

# prevent access to LICENSE
<Files LICENSE>
Order allow,deny
Deny from all
Satisfy all
</Files>

# prevent access to csv, txt and md files
<FilesMatch "\.(csv|txt|md|yml|json|lock)$">
Order allow,deny
Deny from all
Satisfy all

nano 000-default.conf,我将 DocumentRoot 从 /var/www/html 更改为 /var/www/html/public。在此之后,会出现此错误,在此之前,它将显示 html 中的所有内容,并且 html/public 也无法访问。

另外,我对这个加密的描述有疑问,我在导师那里问过这个问题

Now you want to add your encryption key. You can generate a 
CodeIgniter encryption key automatically using the Random Key 
Generator website. Type:

nano config.php

Find the code that says $config['encryption_key'] and add your key. 
Then press Ctrl-x to exit, making sure you save your changes. 

答案1

我知道这个问题有点老了,但这个答案可能会对其他人有所帮助,我刚才遇到了同样的问题,在我启用 php 错误显示到屏幕后,结果发现php-bcmath 模块错误在我的 ubuntu 18.04 服务器上安装并启用它之后,错误 500 消失了。

答案2

5XX 错误几乎肯定会在您的 httpd 日志中留下一条日志消息。您应该跟踪该错误消息,借助您最喜欢的搜索引擎和一些研究,这些信息将引导您找到解决方案。

相关内容