Fatal error: require()

I have a site with the following directory structure
/dhtmlx
/toitoi (where my code resides)

a simple page to feed a grid as this (cnctListUtenti.php)

<?php require_once("./toitoi_config.php"); $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass); mysql_select_db($mysql_db); require("/dhtmlx/connector/codebase/grid_connector.php"); $grid = new GridConnector($res); $grid->dynamic_loading(100); $grid->render_table("usr","Id","username,Fullname,sigla"); ?>

The problem is with the >> require(“/dhtmlx/connector/codebase/grid_connector.php”) << line.

I get the following error even though the path is correct :

Warning: require(/dhtmlx/connector/codebase/grid_connector.php) [function.require]: failed to open stream: No such file or directory in C:\webroot\toitoi\cnctListUtenti.php on line 8

Fatal error: require() [function.require]: Failed opening required ‘/dhtmlx/connector/codebase/grid_connector.php’ (include_path=‘.;C:\Program Files (x86)\PHP\v5.3\pear’) in C:\webroot\toitoi\cnctListUtenti.php on line 8

IF I try to open the relative file in the browser, i.e.
localhost/dhtmlx/connector/codeb … nector.php

I get:

Strict Standards: Declaration of GridConnector::fill_collections() should be compatible with that of Connector::fill_collections() in C:\webroot\dhtmlx\connector\codebase\grid_connector.php on line 126

Strict standard issue is non-critical one and not related to the require error

Please check that path is correct, maybe you have missed dot at start of path ?

require("./dhtmlx/connector/codebase/grid_connector.php");

Actually no. No missing dots. I solved it but i don’t understsand:

As I said, in the route of the web are two folders:
dhtmlx
toitoi

The code is in toitoi, so to include something in dhtmlx, I would expect the path to be:
/dhtmlx/ …whatever
i.e. upto root and then down to dhtmlx
This does NOT work, but if I put
…/dhtmlx/ …whatever
then it does.
i.e. up one dir and then down to dhtmlx

I don’t understand why “up to root” ("/") and “up one” ("…/") give different results, they should both take me to the root of the web where the dhtmlx folder is!

Actually, when you are starting from “/” in the path, it will count it as start of OS filesystem, not as top web folder - that may be the reason of confusion.

Fine! That explains it!
Thanks

I got the:
Strict Standards: Declaration of GridConnector::fill_collections()
Error when I started fiddling with the dhtmlxGrid library.

Developer should really change the example code to not error_log() on the require line, instead of making people change their PHP error reporting settings.

require("/dhtmlxGrid/codebase/grid_connector.php");
becomes
@require("/dhtmlxGrid/codebase/grid_connector.php");
and all works fine.

The latest version of php connector must not cause problems when “Strict Standards” error reporting was enabled.

github.com/DHTMLX/connector-php