简体   繁体   English

将代码移动到新服务器后出现 500 错误

[英]500 Error After Moving Code To New Server

I recently moved my code to a new server with Debian 10 and PHP 7.3.19.我最近将代码移到了装有 Debian 10 和 PHP 7.3.19 的新服务器上。 The old server had Ubuntu 16.04.15 and PHP 7.0.33.旧服务器有 Ubuntu 16.04.15 和 PHP 7.0.33。 As a result, I am now getting a 500 error on my index.php page.结果,我现在在 index.php 页面上收到 500 错误。 However, if I comment out part of the TinyButStrong template code, the error goes away and loads.但是,如果我注释掉 TinyButStrong 模板代码的一部分,错误就会消失并加载。 Below is a snippet of the code and the commented out section.下面是代码片段和注释掉的部分。

$tbs_source = ($DBConn===false) ? 'clear' : $DBConn;
// Merge data and close connection
$TBS->MergeBlock('songblock', $tbs_source, $sql);

/*$TBS->MergeBlock('titleblock', $tbs_source,
'SELECT t.*, stt.sortID FROM titles t 
        INNER JOIN songlist_titles_tunes stt ON t.ID = stt.titlesID 
        WHERE stt.songlistID = %p1% GROUP BY t.ID ORDER BY stt.sortID');
$TBS->MergeBlock('tuneblock', $tbs_source,
'SELECT tunes.*, stt.sortID FROM tunes 
        INNER JOIN songlist_titles_tunes stt ON tunes.id = stt.tunesID
        WHERE songlistID = %p1% AND titlesID = %p2% ORDER BY stt.sortID'); // */

$DBConn = null; // this is the method to close PDO connection

The version of TBS is: TBS的版本是:

 * TinyButStrong - Template Engine for Pro and Beginners
 *
 * @version 3.11.0 for PHP 5 and 7
 * @date    2019-02-10

Any thoughts on why just that section is raising a 500 error?关于为什么只有该部分会引发 500 错误的任何想法?

Check your htaccess file.检查您的 htaccess 文件。 Maybe some features of your old server is not enabled in your new server.也许您的新服务器中没有启用旧服务器的某些功能。 Also check the file's permission.还要检查文件的权限。 chmod it to 755.将其修改为 755。

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

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