I am hosting a site locally with <strong>MAMP</strong>. I have the virtual host setup properly and the index.php file does get pulled up when i reference the local URL: my.example.local
The issue is that the PHP file includes are not working. Here is a sample of the code:
<?php session_start(); $_SESSION['message'] = ''; require_once "includes/config.php"; require_once "includes/classes/facilities.class.php"; require_once "includes/classes/states.class.php"; $title = "Home"; $sub_title = $title; $reset = false; require_once "includes/header.php"; ?>
and here is the error message i get when accessing index.php:
Warning: require_once(includes/classes/facilities.class.php): failed to open stream: No such file or directory in /Users/userName/IOD/portal/index.php on line 9 Fatal error: require_once(): Failed opening required 'includes/classes/facilities.class.php' (include_path='.:/Applications/MAMP/bin/php/php5.4.10/lib/php') in /Users/userName/IOD/portal/index.php on line 9
For the record I have tried multiple different ways of referencing the file path, relative, absolute, using the host name, etc.
I am willing to try anything but haven't had any luck so far. Oh and before you ask, yes the files are in the referenced location but for some reason the (local)server doesn't seem to think they are.
Note: this works fine on the web server, I was trying to host it locally to implement version control so I can Dev locally and push changes to the server.Answer1:
If you put your include/ folder into this folder;
/Users/jfloyd/IOD/includes/<all in here>
Then alter this line in your PHP ini from:
Then save the file and restart your server, then the include files should be found.
This ini directive can be set in any number of places, in each file, in each folder using .htaccess or in httpd.conf or in the ini file, as I just described.