0

I have seen this question asked and answered many times, but I can't seem to get a solution for myself

Here is my basic folder structure:

http://localhost/cms/

To grab all my code I have a utilities file located here:

http://localhost/cms/includes/utilities.inc.php

and within that file I have requires()s to include classes, as such:

require('classes/Post.php');
require('classes/User.php');
require('classes/Comments.php');
require('classes/Category.php');

when I try and include my http://localhost/cms/includes/utilities.inc.php file into the following directory it doesn't work! http://localhost/cms/admin/

when I try I get this error:

Warning: require(classes/Post.php): failed to open stream: No such file or directory in C:\xampp\htdocs\cms\includes\utilities.inc.php on line 12

Fatal error: require(): Failed opening required 'classes/Post.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cms\includes\utilities.inc.php on line 12

When Using Absolute Paths In My Utility File:

require('http://localhost/cms/classes/Post.php');
require('http://localhost/cms/classes/User.php');
require('http://localhost/cms/classes/Comments.php');
require('http://localhost/cms/classes/Category.php');

I get the following error:

Warning: require(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\xampp\htdocs\cms\includes\utilities.inc.php on line 12

Warning: require(http://localhost/cms/classes/Post.php): failed to open stream: no suitable wrapper could be found in C:\xampp\htdocs\cms\includes\utilities.inc.php on line 12

Fatal error: require(): Failed opening required 'http://localhost/cms/classes/Post.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cms\includes\utilities.inc.php on line 12

How can I get a system that will link properly (preferably WITHOUT anything PEAR related)?

rand_user91
  • 83
  • 1
  • 1
  • 12
  • I also changed `allow_url_include=Off` to `allow_url_include=On` in the `php.ini` file and that did not solve the issue either – rand_user91 Jul 10 '14 at 12:39
  • I am not sure what is happening: these links may be useful: http://stackoverflow.com/questions/6887338/wrapper-is-disabled-in-the-server-configuration-by-allow-url-include-0 and http://stackoverflow.com/questions/23285503/warning-require-once-http-wrapper-is-disabled-in-the-server-configuration. The internet search was: 'php allow_url_include=0'. – Ryan Vincent Jul 10 '14 at 20:32

0 Answers0