Jump to content
php.lv forumi

"URL file-access is disabled in the server configuration"


daGrevis

Recommended Posts

Problēma ir pavisam vienkārša. Ir galvenais fails (core.php), kurā ir norādīts "$rootPath" un "$stylePath".

 

$rootPath = $serverProtocol . "://" . $serverDirectory . "/" . $serverSubDirectory . "/";
$stylePath = $rootPath . "styles/" . $defaultStyle . "/";

 

Tad core.php ir iekļauts konfigurācijas fails.

 

$serverProtocol = 'http';
$serverDirectory = '127.0.0.1';
$serverSubDirectory = 'prototype';
$defaultStyle = "proLite";

 

Veidojot funkciju core.php failā - "overallHeader", dabūju šādu ķļudu.

 

Warning: require() [function.require]: URL file-access is disabled in the server configuration in D:\xampp\htdocs\prototype\includes\core.php on line 39

Warning: require(http://127.0.0.1/prototype/styles/proLite/overallHeader.php) [function.require]: failed to open stream: no suitable wrapper could be found in D:\xampp\htdocs\prototype\includes\core.php on line 39

Fatal error: require() [function.require]: Failed opening required 'http://127.0.0.1/prototype/styles/proLite/overallHeader.php' (include_path='.;D:\xampp\php\pear\') in D:\xampp\htdocs\prototype\includes\core.php on line 39

 

Funkcija izskatāš šāda.

 

function overallHeader($pageTitle = "")
{
global $alive, $siteTitle, $stylePath;

if(!$alive) {
	echo "Site is down for maintenance, please check back again later...";
	die;
}

if($pageTitle == "") {
	$pageTitle = $siteTitle;
}

header("Content-Type: text/html; charset=utf-8");

require $stylePath . "overallHeader.php";
}

 

Idejas? Vai norādīt "root" mainīgos savādāk, vai ieslēgt serveī tādu iespēju? ;?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...