Hi I have this database_setup script witten in php. I have a project in a Linux debian machine. The top of the file looks like this:
database_setup.php
require_once("../classes/admin.php");
require_once("../classes/client.php");
require_once("../classes/database.php");
require_once("./config.php");
But when I run php database_setup.php
I get the following error:
PHP Warning: require_once(../classes/admin.php): failed to open stream:
No such file or directory in /path/to/the/file/database_setup.php on line 6
PHP Fatal error: require_once():
Failed opening required '../classes/admin.php'
(include_path='.:/usr/share/php:/usr/share/pear')
in /path/to/the/file/database_setup.php on line 6
When I run other code as usual with "normal" contact with the database (I mean the normal case being one where the files of models (as client and admin ) are in the same directory as the database) there is no fatal error or warning.
The config.php file contains the password and name of the db, and so on, which the database.php requires(_once). And the database_setup is in the same folder as the config file.
I really don't understand why the code works on my MAMP server on my mac but not on another system. Has it to do with apache2.conf or something else? Thanks.