Jump to content
Larry Ullman's Book Forums

web1868

Members
  • Posts

    9
  • Joined

  • Last visited

Posts posted by web1868

  1. hi i uploaded a website using the includes infrastructure exampled in this book

    my base uri for xamp is define ('BASE_URI', '/C:xamp/htdocs/'); and it works fine

     

    but im using filezilla to upload folders to my site hosting on go daddy and when i use my httpdocs path

     define ('BASE_URI', '/httpdocs/'); i get this error:

     

    PHP Fatal error: require(): Failed opening required '/httpdocs/mysql.inc.test.php' (include_path='.;.\includes;.\pear') in G:\PleskVhosts\axebs.com\httpdocs\index.php on line 16

     

     

     

    any tips on what i need to set my path to to work on filezilla??

  2. yea im running on windows 64 bit. so i deleted the slash in front of C: now my base_uri looks like '/C:xampp/htdocs/'

    and im still getting the error message

     

    An error occurred in script 'C:\xampp\htdocs\html\index.php' on line 15:
    require(/C:xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument

    Array(    [0] => Array        (            [file] => C:\xampp\htdocs\html\index.php            [line] => 15            [function] => my_error_handler            [args] => Array                (                    [0] => 2                    [1] => require(/C:xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument                    [2] => C:\xampp\htdocs\html\index.php                    [3] => 15                    [4] => Array

    if i use mu base uri 'C:xampp/htdocs/' "without the slash behind it" i get an exceed execution time error

     

     

     

    ive tried multiple uri combinations could there be something more than a simple uri error maybe a path environment variable issue?

  3.   my code now looks like this     and it pays to know
    An error occurred in script 'C:\xampp\htdocs\index.php' on line 7:
    require(/C:xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument
    Array(    [0] => Array        (            [file] => C:\xampp\htdocs\index.php            [line] => 7            [function] => my_error_handler            [args] => Array                (                    [0] => 2                    [1] => require(/C:xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument                    [2] => C:\xampp\htdocs\index.php                    [3] => 7                    [4] => Array                        (                            [_GET] => Array                                (                                )                            [_POST] => Array                                (                                )                            [_COOKIE] => Array                                (                                    [sbOverlayID] => 51111639                                )                            [_FILES] => Array
  4.  

    the error is occuring in this code

     

    // Are we live?

    $live = false;

     

    // Errors are emailed here:

    $contact_email = '######@gmail.com';

     

    // ************ SETTINGS ************ //

    // ********************************** //

     

    // ********************************** //

    // ************ CONSTANTS *********** //

     

    // Determine location of files and the URL of the site:

    define('BASE_URI','/C:/xampp/htdocs/');

     

    define('BASE_URL', 'http://localhost:8080/');

     

    define('MYSQL', BASE_URI. 'mysql.inc.php');

     

    // ************ CONSTANTS *********** //

    // ********************************** //

     

    // ********************************* //

    // ************ SESSIONS *********** //

     

    // Start the session:

    session_start();

     

    // ************ SESSIONS *********** //

    // ********************************* //

     

    // ****************************************** //

    // ************ ERROR MANAGEMENT ************ //

     

    // Function for handling errors.

    // Takes five arguments: error number, error message (string), name of the file where the error occurred (string) 

    // line number where the error occurred, and the variables that existed at the time (array).

    // Returns true.

    function my_error_handler ($e_number, $e_message, $e_file, $e_line, $e_vars) {

     

    // Need these two vars:

    global $live, $contact_email;

     

    // Build the error message:

    $message = "An error occurred in script '$e_file' on line $e_line:\n$e_message\n";

     

    // Add the backtrace:

    $message .= "<pre>" .print_r(debug_backtrace(), 1) . "</pre>\n";

     

    // Or just append $e_vars to the message:

    // $message .= "<pre>" . print_r ($e_vars, 1) . "</pre>\n";

     

    if (!$live) { // Show the error in the browser.

     

    echo '<div class="error">' . nl2br($message) . '</div>';

     

    } else { // Development (print the error).

     

    // Send the error in an email:

    error_log ($message, 1, $contact_email, 'From:admin@example.com');

     

    // Only print an error message in the browser, if the error isn't a notice:

    if ($e_number != E_NOTICE) {

    echo '<div class="error">A system error occurred. We apologize for the inconvenience.</div>';

    }

     

    } // End of $live IF-ELSE.

     

    return true; // So that PHP doesn't try to handle the error, too.

     

    } // End of my_error_handler() definition.

     

    // Use my error handler:

    set_error_handler ('my_error_handler');

     

  5. An error occurred in script 'C:\xampp\htdocs\index.php' on line 7:
    require(/C:/xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument
    Array

    (

    [0] => Array

    (

    [file] => C:\xampp\htdocs\index.php

    [line] => 7

    [function] => my_error_handler

    [args] => Array

    (

    [0] => 2

    [1] => require(/C:/xampp/htdocs/mysql.inc.php): failed to open stream: Invalid argument

    [2] => C:\xampp\htdocs\index.php

    [3] => 7

    [4] => Array

×
×
  • Create New...