如何使用Viewen连接到实时服务器

时间:2018-11-24 14:33:34

标签: php mysqli

我正在尝试使用Viewen将我的网站放置在实时服务器上,但是由于某些原因,我遇到以下错误。我不确定为什么会发生错误,因为我已将所有文件上载到同一个public_html文件夹中。我从他们那里得到的唯一帮助就是创建了一个新数据库,下面是我的凭据:我不确定dbh.php的设置是否正确:

<?php

$dbservername = "localhost";
$dbroot = "root";
$dbpassword = "";
$dbdatabase = "pianocou_loginsystem";

$conn = @mysqli_connect($dbservername, $dbroot, $dbpassword, $dbdatabase);


I got rid of the password just for security reason but did include it in my dbh.. Must I change the dbroot? They also told me to leave it as localhost for the server.

[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(header2.php): failed to open stream: No such file or directory in /home/pianocou/public_html/index.php on line 6
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(): Failed opening 'header2.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/pianocou/public_html/index.php on line 6
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(viewcounter.php): failed to open stream: No such file or directory in /home/pianocou/public_html/index.php on line 7
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(): Failed opening 'viewcounter.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/pianocou/public_html/index.php on line 7
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Notice:  Undefined variable: views in /home/pianocou/public_html/index.php on line 118
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(footer.php): failed to open stream: No such file or directory in /home/pianocou/public_html/index.php on line 126
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(): Failed opening 'footer.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/pianocou/public_html/index.php on line 126
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(includes/dbh.php): failed to open stream: No such file or directory in /home/pianocou/public_html/index.php on line 127
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  include_once(): Failed opening 'includes/dbh.php' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/pianocou/public_html/index.php on line 127
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Notice:  Undefined variable: conn in /home/pianocou/public_html/index.php on line 131
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP Warning:  mysqli_stmt_init() expects parameter 1 to be mysqli, null given in /home/pianocou/public_html/index.php on line 131
[25-Oct-2018 10:46:32 UTC] PHP Stack trace:
[25-Oct-2018 10:46:32 UTC] PHP   1. {main}() /home/pianocou/public_html/index.php:0
[25-Oct-2018 10:46:32 UTC] PHP   2. mysqli_stmt_init() /home/pianocou/public_html/index.php:131
[25-Oct-2018 10:46:32 UTC] PHP Warning:  mysqli_stmt_prepare() expects parameter 1 to be mysqli_stmt, null given in /home/pianocou/public_html/index.php on line 133

我的大多数错误都说同样的话。...

enter image description here

1 个答案:

答案 0 :(得分:0)

数据库根不是该根,它将是您的数据库用户,并确保数据库用户对数据库具有完全权限。