DBConnection error and include_once error

39
December 02, 2020, at 8:50 PM

Now i hope this topic stays here,

Im trying to install a webpage on my own server, im working on a windows 2019 server with IIS and PHP 7.1

I have installed The zend loader 7.1 with no errors, the page need that one to work.

My structure on the page is :

wwwroot: index.php, common.php
wwwroot/assets/libraries: defines.php, class.dbquery.php

But when i open the page on localhost i only see errors.

My errors:

Fatal error:  Uncaught Error: Class 'DBConnection' not found in \assets\libraries\defines.php:37
Stack trace:
#0 \common.php(15): require_once()
#1 \index.php(2): include_once('C:\\inetpub\\wwwr...')
#2 {main}
  thrown in \assets\libraries\defines.php on line 37

In \assets\libraries\defines.php line 37 is the DBConnection that gives fatal error.

if($_SERVER["HTTP_HOST"] == "localhost")
    {
        define( 'TSITE_SERVER','localhost');
        define( 'TSITE_DB','xxxxx');
        define( 'TSITE_USERNAME','root');
        define( 'TSITE_PASS','xxxxx');
    }
define('PAYPAL_CLIENT_ID', ''); // Paypal client id
define('PAYPAL_SECRET', ''); // Paypal secret

if(!isset($obj))
{
    require_once(TPATH_CLASS."class.dbquery.php");
    $obj=   new DBConnection(TSITE_SERVER, TSITE_DB, TSITE_USERNAME,TSITE_PASS);
}

in common.php it´s require_once a php script that i have in the assets/libraries folder.

require_once TPATH_BASE . DS . "assets" . DS . "libraries" . DS . "defines.php";

and from index.php it´s include_once common.php that is in the same folder as index.php.

<?php
  include_once("common.php");

I have search on the internet based on the error, but i cant find anything, This kind of code is new for me. And i can´t remove the errors.

READ ALSO
Arranging rectangles in a circle with equal distance

Arranging rectangles in a circle with equal distance

I'm writing a program that renders mind mapsSo far, I've succeeded in drawing the root node and the first level of child nodes around it, in a circle

26
How to filter integer value based on string parameter input on list on kotlin?

How to filter integer value based on string parameter input on list on kotlin?

I am trying to filter an object type list based on a string value which is working fine, but now I need to filter based on an integer attribute of the objects on the list

50
execute php Shortcode on button click

execute php Shortcode on button click

I am trying to execute a php shortcode on button click but that is not running

38
Python uncatchable IOError [Errno 32] Broken pipe from Popen within Pool

Python uncatchable IOError [Errno 32] Broken pipe from Popen within Pool

I have a Python 27 code which is running two piped suprocess Popens with multiprocessing Pool as follows

58