• Resolved Hugh H.

    (@hhhsands)


    Hi:

    I’m a newbie in WordPress working in a site running fine locally but reporting the classical error in the remote server when an include (with the data to connect to a custom DB) can’t be found

    Thanks in advance

    Warning: require(../connections/connFTFront.php) [function.require]: failed to open stream: No such file or directory in /homepages/…/htdocs/fashion/blog/wp-content/themes/fashion/inc/dbConn.php on line 2

    Fatal error: require() [function.require]: Failed opening required ‘../connections/connFTFront.php’ (include_path=’.:/usr/lib/php5′) in /homepages/…/htdocs/fashion/blog/wp-content/themes/fashion/inc/dbConn.php on line 2

    Site structure
    .htaccess
    index.php
    blog/wp-content/themes/fashion/
    by-brand.php
    inc/dbConn.php
    connections/connFTFront.php
    ===================
    by-brand.php

    <?php
    /*
    Template Name: By brand
    */
    require_once('inc/dbConn.php');
    
    get_header(); ?>
      <div id="container">
      ...

    ===================
    dbConn.php

    <?php
      require('../connections/connFTFront.php');
      mysql_select_db($database_connFT, $connFT);
    ?>

    ===================
    connFTFront.php

    <?php
    $hostname_connFT = "localhost";
    $database_connFT = "db";
    $username_connFT = "user";
    $password_connFT = "pwd";
    $connFT = mysql_pconnect($hostname_connFT, $username_connFT, $password_connFT) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>

    ===================

    WordPress 3.1
    Development
    OS X 10.5.8
    XAMPP 1.7.3
    PHP 5.3.1
    include_path
    .:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear

    Production
    Linux
    PHP 5.2.17
    include_path
    .:/usr/lib/php5

Viewing 1 replies (of 1 total)
  • Thread Starter Hugh H.

    (@hhhsands)

    It seems WP doesn’t like relative paths, changed them to absolute ones and everything is fine in remote server

    Just curious why relative paths works ok in local installation

Viewing 1 replies (of 1 total)
  • The topic ‘Can not find included file in remote server’ is closed to new replies.