not loading

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

not loading

Post 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:

Code: Select all

<?php
echo "php is working";
?>
and you see it's working:click here to see
this software also uses pear and mysql codes
can you guess any reason?
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post by iknownothing »

so there is more code than this?

It could be anything. Post more code.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Re: not loading

Post 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.
m2babaey
Forum Contributor
Posts: 364
Joined: Sun May 20, 2007 9:26 am

Post 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;
}
?>
User avatar
iknownothing
Forum Contributor
Posts: 337
Joined: Sun Dec 17, 2006 11:53 pm
Location: Sunshine Coast, Australia

Post 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.

Code: Select all

require_once '../config.php';
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.
Post Reply