require_once
require_once

Reputation: 2045

What does $config mean

I am creating a wordpress blog.I had a Tutorial but i cant uderstand that what does $config['pathSrcInclude'] mean? As in:

include_once($config['pathSrcInclude']."common.inc.php");

I am getting an error like this

/Warning: include_once() [function.include]: Failed opening 'src/common.inc.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/66/8073766/html/thinkblogger.com/popups/photos.php on line 8

Please anyone know the reason behind it?

Upvotes: 1

Views: 241

Answers (3)

djdy
djdy

Reputation: 6919

What Chris Cummings said, plus, check your permissions on that file.

Make sure it is accessible by scripts (probably CHMOD 0755).

Upvotes: 0

Zuul
Zuul

Reputation: 16269

By what your telling, the problem seems to be the path for the file... it's wrong and PHP generates a WARNING telling you just that!

$config seems to be and array of configuration values, and the pathSrcInclude should contaion the right path for the file that you are trying to include.

Upvotes: 0

Chris Cummings
Chris Cummings

Reputation: 1548

This:

$config['pathSrcInclude']

is looking in an array called $config for the element pathSrcInclude

From what i'm seeing the line you have shown is trying to include a file but its not in the location submitted.

Based on the error you are getting the array element above contains this string: "src/"

So what that line is actually doing is looking for this:

include_once("src/common.inc.php");

Which should be the location of a file, but from the looks of your error the file isn't there.

Hope this helps, Chris

Upvotes: 4

Related Questions