Page 1 of 1
not loading
Posted: Sun Aug 19, 2007 7:47 am
by m2babaey
hi
i coded a software that was working fine last week. but i noticed that none of it's php fines is working. the pages are not loading. see
this url for example
i was confused and thought maybe the php softwares on the server are not running properly, so tested a php file:
working.php:
and you see it's working:
click here to see
this software also uses pear and mysql codes
can you guess any reason?
Posted: Sun Aug 19, 2007 7:58 am
by iknownothing
so there is more code than this?
It could be anything. Post more code.
Re: not loading
Posted: Sun Aug 19, 2007 8:19 am
by The Phoenix
m2babaey wrote:
can you guess any reason?
Not without seeing the code. Try looking in your web server logs, and your php logs, but its not a sure thing it will appear there. Then turn on error reporting in the script, and see if it produces errors in the output.
Posted: Sun Aug 19, 2007 11:20 am
by m2babaey
in almost all of the pages that are not loaded (but were loading already) (like
http://textly.fr/login.php ) this code is used on the top:
include 'global.php';
and global.php is:
Code: Select all
<?php
/* $Id: global.php,v 1.65 2002/09/20 08:57:24 shaggy Exp $ */
session_start(); // keep above lib/user.php and functions.php
require_once 'functions.php';
require_once '../config.php'; // before session_defaults
require_once 'session_defaults.php';
require_once 'lib/user.php';
include 'error.php';
$db = db_connect();
$user = new User($db);
?>
and config.php is:
Code: Select all
<?php
function handlePearError($error) {
header('HTTP/1.0 500 Internal Server Error');
//die("$error->message<br />$error->userinfo"); // uncomment this to debug
die('Error ocurred, please try again later');
}
function &db_connect() {
require_once 'DB.php';
$dsn = "mysql://root:@unix+localhost/adsense";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die("Database connection failed.");
}
$db->setFetchMode(DB_FETCHMODE_OBJECT);
$db->setErrorHandling(PEAR_ERROR_CALLBACK, 'handlePearError');
return $db;
}
?>
Posted: Sun Aug 19, 2007 11:26 am
by iknownothing
are all your files in the locations you have written into the code? require_once means, if it can't find it, the whole page won't load.
Obviously, I don't know your filestructure, but as far as I can tell, the config.php seems to be too far up the filesystem tree to be correct. But I may be wrong.