guys chk out that link its really hard to solve :O

i have windows 7
and calling my database from online SQL :'(

Dani AI

Generated

Good catch by — path problems are the most common cause of a silent include failure, but there are a few more checks that make debugging fast and reliable.

Turn on full error reporting at the top of the script so PHP shows why require_once failed:

ini_set('display_errors', 1);
error_reporting(E_ALL);

Use an absolute path derived from the current file to avoid surprises when the script is included from another location:

$path = __DIR__ . '/Connections/bdata.php';
if (!is_readable($path)) {
    error_log('Missing or unreadable include: ' . $path);
    die('Configuration error');
}
require_once $path;

If the include is fine but the app cannot reach the remote MySQL server, test the TCP connection from the web host (telnet or a MySQL client) and verify the MySQL user is allowed to connect from your webserver IP. Granting remote access looks like:

GRANT ALL PRIVILEGES ON dbname.* TO 'dbuser'@'webserver.ip.address' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

Also check: the webserver PHP error log for fatal include errors, the server-side file permissions (web user must be able to read the file), and phpinfo() for the active include_path and loaded configuration file. If moving between Windows development and a Linux host, confirm filename spelling and case match exactly.

Further reading: PHP require_once details and error handling are in the manual, and MySQL GRANT behavior is documented in the MySQL reference. If the problem persists after these checks, capture the exact PHP fatal message (from the error log) and the include path you tried so the next troubleshooting step can be precise.

Recommended Answers

All 3 Replies

your directory must look like following

webroot
|__________molham
             |________Connections
             |            |_________bdata.php
             |________edary.php

OR set proper path in line require_once(Connections/bdata.php), so that php can locate bdata.php

linux apache is case sensitive , so check the file spelling case in your diretories.

Thanks Man it really helps :D
and wait for another issue :S

dear friend mark this solved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.