bgbs Posted November 25, 2009 Share Posted November 25, 2009 This is weird stuff. This script works on one page, but not in another. All the paths are correct I checked that already number of times. But the page in which I get this error has include inc.db.php file, and if I remove it then the script processes it? I get Warning: error_log(/home/wassoc/public_html/logs/2009-11-25-php-errors.log) [function.error-log]: failed to open stream: No such file or directory in /home/wassoc/public_html/news/wp-settings.php on line 601 this error continues down the page at different lines. Does anyone know why? <?php // Include Wordpress define('WP_USE_THEMES', false); require('news/wp-blog-header.php'); query_posts('showposts=3'); ?><?php while (have_posts()): the_post(); ?> <a href="<?php the_permalink(); ?>"><span class="inline-news-ticker"><?php the_title(); ?></span></a> <?php endwhile; ?> <?php // Turn off all error reporting error_reporting(0); //the reports are not logged to file check /logs/ directory for date function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { global $db; // timestamp for the error entry. $dt = date('Y-m-d H:i:s (T)'); // define an assoc array of error string // in reality the only entries we should // consider are E_WARNING, E_NOTICE, E_USER_ERROR, // E_USER_WARNING and E_USER_NOTICE. $errortype = array ( E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice' ); // set of errors for which a var trace will be saved. $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE,E_ERROR,E_WARNING,E_PARSE); $err = "<errorentry>\n"; $err .= "\t<datetime>" .$dt. "</datetime>\n"; $err .= "\t<errornum>" .$errno. "</errornum>\n"; $err .= "\t<errortype>" .$errortype[$errno]. "</errortype>\n"; $err .= "\t<errormsg>" .$errmsg. "</errormsg>\n"; $err .= "\t<scriptname>" .$filename. "</scriptname>\n"; $err .= "\t<scriptlinenum>" .$linenum. "</scriptlinenum>\n"; if (in_array($errno, $user_errors)) { $err .= "\t<vartrace>" .wddx_serialize_value($vars, 'Variables'). "</vartrace>\n"; } $err .= "</errorentry>\n\n"; // save to the error log file, and e-mail me if there is a critical user error. $logfile = '/home/wassoc/public_html/logs/'.date("Y-m-d").'-php-errors.log'; error_log($err, 3, $logfile); //$db->query(" INSERT INTO log_error (errormsg) VALUES ($err) "); if ($errno == E_USER_ERROR||$errno == E_ERROR ||$errno == E_PARSE||$errno == E_WARNING) { mail('[email protected]', 'Critical User Error', $err); } } $old_error_handler = set_error_handler('userErrorHandler'); /********************************************************************** * ezSQL initialisation for mySQL */ // Include ezSQL core include_once "ezsql/ez_sql_core.php"; // Include ezSQL database specific component include_once "ezsql/ez_sql_mysql.php"; // Initialise database object and establish a connection // at the same time - db_user / db_password / db_name / db_host $db = new ezSQL_mysql('user','pass','database','localhost'); $dbt = new ezSQL_mysql('user','pass','database','localhost'); /********************************************************************** * ezSQL demo for mySQL database */ /* // Demo of getting a single variable from the db // (and using abstracted function sysdate) $current_time = $db->get_var("SELECT " . $db->sysdate()); print "ezSQL demo for mySQL database run @ $current_time"; // Print out last query and results.. $db->debug(); // Get list of tables from current database.. $my_tables = $db->get_results("SHOW TABLES",ARRAY_N); // Print out last query and results.. $db->debug(); // Loop through each row of results.. foreach ( $my_tables as $table ) { // Get results of DESC table.. $db->get_results("DESC $table[0]"); // Print out last query and results.. $db->debug(); } */ ?> Quote Link to comment https://forums.phpfreaks.com/topic/182937-errors-with-php-news-ticker/ Share on other sites More sharing options...
JAY6390 Posted November 25, 2009 Share Posted November 25, 2009 Put simply the file either doesn't exist, or you don't have the necessary privileges to access it Quote Link to comment https://forums.phpfreaks.com/topic/182937-errors-with-php-news-ticker/#findComment-965597 Share on other sites More sharing options...
bgbs Posted November 25, 2009 Author Share Posted November 25, 2009 Put simply the file either doesn't exist, or you don't have the necessary privileges to access it Well, how come I suddenly get privliges when the inc.db.php file is not included? Quote Link to comment https://forums.phpfreaks.com/topic/182937-errors-with-php-news-ticker/#findComment-965601 Share on other sites More sharing options...
JAY6390 Posted November 25, 2009 Share Posted November 25, 2009 Does it write to that particular file or does it just not show errors? Quote Link to comment https://forums.phpfreaks.com/topic/182937-errors-with-php-news-ticker/#findComment-965605 Share on other sites More sharing options...
bgbs Posted November 25, 2009 Author Share Posted November 25, 2009 it writes everything beautifully Quote Link to comment https://forums.phpfreaks.com/topic/182937-errors-with-php-news-ticker/#findComment-965606 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.