-3

I am working on a membership system but every time run my index page i get this error and i dont even understand it please help

Warning: require(Tutorials\mysql.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\xampp\Tutorials\index.php on line 3

Fatal error: require() [function.require]: Failed opening required 'Tutorials\mysql.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\xampp\Tutorials\index.php on line 3

Community
  • 1
  • 1
user1658490
  • 25
  • 1
  • 4
  • 4
    what's no clear? `No such file or directory` – Luca Rainone Oct 14 '12 at 19:12
  • use [set_include_path](http://php.net/manual/en/function.set-include-path.php) to tell the interpreter to start looking in \xampp\htdocs\xampp\Tutorials for this file. – Ohgodwhy Oct 14 '12 at 19:17
  • You might find this helpful: http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/12820243#12820243 – hakre Oct 15 '12 at 07:07

3 Answers3

0

In the file index.php on line 3 it requires you to have a file mysql.php but that file is missing or not found by the interpreter on the location given.

jtheman
  • 7,421
  • 3
  • 28
  • 39
0

Go to C:\xampp\php\ and find the file php.ini.

Find the setting include_path and add the directory C:\xampp\htdocs

In the end you should have something that looks like:

include_path = ".;C:\xampp\php\PEAR;C:\xampp\htdocs or similar.

Don't forget to restart your XAMPP stack!

Afterwards, your stack will look for files that you're trying to include/require in the new path that you've set.

Also in your require line in index.php, try the following:

require_once($_SERVER['DOCUMENT_ROOT'] . '/Tutorials/mysql.php');

This will make it very explicit the path of the file you're trying to include.

Stegrex
  • 4,004
  • 1
  • 17
  • 19
0

Open index.php and change line 3 from

require(Tutorials\mysql.php)

to

require(mysql.php)
n00b
  • 2,738
  • 2
  • 20
  • 31