Link to home
Create AccountLog in
Avatar of atigris
atigris

asked on

Issue with PHP

Hello

I have installed a simple php script with database called open-school, however after copying files to the server and configuring config.php with database username and password.

I'm getting the following error when I try to access index.php

Warning: include_once(ERROR_PAGE) [function.include-once]: failed to open stream: No such file or directory in /home/alink/public_html/os/includes/modules.php on line 87

Warning: include_once() [function.include]: Failed opening 'ERROR_PAGE' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/alink/public_html/os/includes/modules.php on line 87

Open in new window


Apache error log

[Mon Jan 03 09:09:16 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/404.shtml
[Mon Jan 03 09:09:16 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/favicon.ico
[Mon Jan 03 09:09:16 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/404.shtml
[Mon Jan 03 09:09:16 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/os/function.include-once
[Mon Jan 03 09:09:09 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/404.shtml
[Mon Jan 03 09:09:09 2011] [error] [client 99.248.216.65] File does not exist: /home/alink/public_html/favicon.ico

Open in new window


modules.php

<?php
/**
* @file		    includes/modules.php
* @description	Module model for checking, deleting, installing modules.
* @package		Open-School v1.0
* @copyright	Copyright (C) 2005 - 2008 Open-School. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Open-School is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
//Shows a Module
function show_module($params)
 {
  if(is_module($params['module']))
  {
   $view = $params['view'];
   $action = $params['action'];
   $id = $params['id'];
   include(MODULES_PATH.$params['module'].'/controller.php');
   }else{
   return false;
   }  
 }
//Check Module.
function is_module($module_name)
 {
  $connection = db_connect();			
  $query = sprintf("SELECT * FROM modules WHERE name = '%s'",
                    mysql_real_escape_string($module_name));			
			$result = mysql_query($query);			
  //Checking Whether the Result is Empty.
			$number_of_news = mysql_num_rows($result);
			if ($number_of_news == 0) 
			{
			  return false;	
			}			
			return true;			
 }
//Returns the array of modules.
function list_modules()
 {
  $connection = db_connect();			
  $query = 'SELECT * FROM modules WHERE system = 0';
			$result = mysql_query($query);
  //Checking Whether the Result is Empty.
			$number_of_news = mysql_num_rows($result);
			if ($number_of_news == 0) 
			{
			  return false;	
			}
			$result = result_to_array($result);
			return $result;			
 }
function list_modules_menu()
 {
  $connection = db_connect();			
  $query = 'SELECT * FROM modules WHERE show_menu = 1';
			$result = mysql_query($query);
  //Checking Whether the Result is Empty.
			$number_of_news = mysql_num_rows($result);
			if ($number_of_news == 0) 
			{
			  return false;	
			}
			$result = result_to_array($result);
			return $result;			
 }
 //Load template.
function load_template($module,$view)
{
 if (file_exists(TEMPLATE_PATH.'modules/'.$module.'/'.$view.'.php'))
 { include_once(TEMPLATE_PATH.'modules/'.$module.'/'.$view.'.php');}
elseif (file_exists(TEMPLATE_PATH.'modules/'.$module.'/index.php'))
 { include_once(TEMPLATE_PATH.'modules/'.$module.'/index.php');}
elseif (file_exists(TEMPLATE_PATH.'index.php'))
 { include_once(TEMPLATE_PATH.'index.php');}
elseif (file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.$view.'.php'))
 { include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.$view.'.php');}
elseif (file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.'index.php'))
 { include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/modules/'.$module.'/'.'index.php');}
elseif (file_exists(SERVER_ROOT.APP_ROOT.'/templates/oslite/index.php'))
 { include_once(SERVER_ROOT.APP_ROOT.'/templates/oslite/index.php');}
else
 { include_once(ERROR_PAGE);}
}
?>

Open in new window

I would appreciate any help!
Avatar of gplana
gplana
Flag of Spain image

check if the file is there and the owner user and its permissions. Maybe file exists but apache user can't see it.

Hope it helps.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I think the problem with file permissions or file is missing. Upload all files again in binary FTP mode and then try to access index page.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of atigris
atigris

ASKER

Thanks
I have also installed a simple php script with database called open-school, however after copying files to the server and configuring config.php with database username and password

I'm getting this error when I try to access index.php


Warning: include_once(ERROR_PAGE) [function.include-once]: failed to open stream: No such file or directory in /home/alink/public_html/Sam/includes/modules.php on line 87
@adeayodele: You might consider posting a question of your own about this.  ;-)