guilhermebueno6
guilhermebueno6

Reputation: 3

My require_once has a right path but doesn't work

This is what my directory looks like:

>admin
  >scripts
     file.php
>config
  database.php

I'm trying to use

require_once '../config/database.php';

on the file.php, but it doesn't seem to be able to find said file. Gives me the error

Warning: require_once(../load.php): failed to open stream: No such file or directory in C:/path_to_file.php

Upvotes: 0

Views: 48

Answers (1)

Alucard Nemesis
Alucard Nemesis

Reputation: 67

require_once '../../config/database.php';

Try this. I think you have to go backwards twice :)

Upvotes: 1

Related Questions