Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Sep 2018
    Posts
    268
    Thanks
    77
    Thanked 0 Times in 0 Posts

    how to set up live website at viewen

    hey guys!

    I have got an account with viewen and trying to set up my database account. They informed me that the dbroot is the username but when I typed my credentials, I still got an sql error:

    Code:
    [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:
    I remember that all of my localhost files starts with 'includes/dbh.php' etc, must I change all the path of my files to home/pianocou/public_html/includes/dbh.php?

  2. #2
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    11,211
    Thanks
    6
    Thanked 1,347 Times in 1,316 Posts
    This is not an SQL error and has nothing to do with the database, this is a PHP error and indicates that the file “header2.php” can’t be found in the location you specified. You shouldn’t need to change the path unless you somehow changed the location of the file relative to the file including it. The error message says that your code is include_once('header2.php'); which means your header2.php file is searched for in the same location as the index.php file, i. e. no “includes” directory or whatever. Is the file there?

  3. #3
    Regular Coder
    Join Date
    Sep 2018
    Posts
    268
    Thanks
    77
    Thanked 0 Times in 0 Posts
    Hello!

    I have checked and all the files are in the same directory... This is very strange indeed because my style.css is there as well... With regard to dbroot, is this the username that I have to enter?
    Last edited by piano0011; Nov 25th, 2018 at 11:35 AM.

  4. #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    4,249
    Thanks
    3
    Thanked 552 Times in 537 Posts
    Given that the error log entries you posted above are from three weeks before you started this thread, have nothing to do with any sql problem, and the included files are apparently (just now tested) being included on your live site, what are the current symptoms or errors you are getting the lead you to believe something isn't working?
    Last edited by CFMaBiSmAd; Nov 25th, 2018 at 03:20 PM.
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.

  5. #5
    Regular Coder
    Join Date
    Sep 2018
    Posts
    268
    Thanks
    77
    Thanked 0 Times in 0 Posts
    I have included both my main page for my live website and localhost website respectively. As can be seen, the css doesn't look to be working at all or doesn't seem to be included in my main page. I can't even get my navigation menu to be displayed...

    -viewen-live-website-png

    -localhost-website-jpg
    Last edited by piano0011; Nov 26th, 2018 at 11:13 AM.

  6. #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    4,249
    Thanks
    3
    Thanked 552 Times in 537 Posts
    Your live site is finding and loading the style.css and the fontawesome all.css files (see the browser developer tools - network tab.) You are not getting the expected output because a nondescript 'sql error' is occurring in the php code somewhere and stopping the html output at line 141 (see the 'view source' of your pages in your browser.) You were told multiple times and given the one line of php code needed to handle database statement errors so that they would be logged/displayed the same as php errors, which would have included the file name, line number, and actual error information, but you refused to make use of this suggestion. You are also outputting multiple html documents on the page, which is invalid. This is likely because the php files you are including into the html document either are themselves or include other php files that try to produce complete html documents, not just pieces that make up one page (you are linking to and redirecting to the same files that are being including, which is nonsense.)
    Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •