+ Reply to Thread
Results 1 to 6 of 6

Thread: pb PHP with "include"

  1. #1
    fomalhaut is offline x10Hosting Member fomalhaut is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    South of France near Arles
    Posts
    91

    pb PHP with "include"

    Hello.

    I've these messages when I execute the index.php file of my site :

    Warning: include(ident.php) [function.include]: failed to open stream: No such file or directory in /home/usr/public_html/index.php on line 15

    Warning: include() [function.include]: Failed opening 'ident.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/usr/public_html/index.php on line 15

    Line 15 is : include('ident.php');

    Am I obliged to put my php scripts (e.g. "ident.php" in this directory : /usr/lib/php or /usr/local/lib/php ? or can I change the include path and if yes, where ?

    Thanks for your help.

  2. #2
    arsalanjalali is offline x10Hosting Member arsalanjalali is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    15

    Re: pb PHP with "include"

    hi
    please say what's your cms?or information about your script.

  3. #3
    fomalhaut is offline x10Hosting Member fomalhaut is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    South of France near Arles
    Posts
    91

    Re: pb PHP with "include"

    Scuse me, I'm french and I don't understand what the meaning of "cms" ?

    This is my whole script "index.php" (in red is the line 15) :

    <html><head><title>Fomalhaut</title>
    <!-- <SCRIPT language=JavaScript src="orgueraphelerepert.js"></script> -->
    <link rel=stylesheet href="Fomalhaut.css" type="text/css">
    </head>
    <body >
    <div class="flot"><center>
    <form action="Ident.php" method="post">
    Identifiant :<br /><input type="text" name="utilisateur" /><br />
    Mot de Passe :<br /><input type="password" name="upass" /><br />
    <input type="submit" />
    </form></center>
    </div>
    <h1>Fomalhaut</h1>
    <?php

    include("ident.php");
    ?>
    <div class="baspage" >
    Fomalhaut est hébergé sur
    <script language=JavaScript>
    document.write(location.hostname);
    </script>
    </div></center>
    </body>
    </html>

  4. #4
    arsalanjalali is offline x10Hosting Member arsalanjalali is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    15

    Re: pb PHP with "include"

    Quote Originally Posted by fomalhaut View Post
    Scuse me, I'm french and I don't understand what the meaning of "cms" ?

    This is my whole script "index.php" (in red is the line 15) :

    <html><head><title>Fomalhaut</title>
    <!-- <SCRIPT language=JavaScript src="orgueraphelerepert.js"></script> -->
    <link rel=stylesheet href="Fomalhaut.css" type="text/css">
    </head>
    <body >
    <div class="flot"><center>
    <form action="Ident.php" method="post">
    Identifiant :<br /><input type="text" name="utilisateur" /><br />
    Mot de Passe :<br /><input type="password" name="upass" /><br />
    <input type="submit" />
    </form></center>
    </div>
    <h1>Fomalhaut</h1>
    <?php

    include("ident.php");
    ?>
    <div class="baspage" >
    Fomalhaut est hébergé sur
    <script language=JavaScript>
    document.write(location.hostname);
    </script>
    </div></center>
    </body>
    </html>
    I want to know what Content management system [cms][like joomla or php-nuke]you used for your website.
    anyway i think your problem refer to ident.php that you must change any part of it.
    Last edited by arsalanjalali; 09-09-2009 at 08:40 AM.

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: pb PHP with "include"

    include_path='.:/usr/lib/php:/usr/local/lib/php'

    1. The first directory is '.' , ie the directory where the running script (in this case, index.php) is located. So, if 'ident.php' is located in /home/usr/public_html,it will be found.

    2. If you use :

    include( 'includes/ident.php');

    then you can create a folder 'includes' in /home/usr/public_html and put ident into /home/usr/public_html/includes

    3. If, for security reasons, you want to keep the included file out of the document root (ie where the webserver [Apache] can see it and send it out over the web), you can put ident.php into /home/usr/etc and then use:

    include( '/home/usr/etc/ident.php');
    Last edited by descalzo; 09-09-2009 at 10:19 AM.
    Nothing is always absolutely so.

  6. #6
    fomalhaut is offline x10Hosting Member fomalhaut is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    South of France near Arles
    Posts
    91

    Re: pb PHP with "include"

    OK, thank you for your answers. My "ident.php" was in the good place, but I've written a Major "I" (Ident), and it was a minor "i" (ident) ;). It's ok now.

    Thanks again.

+ Reply to Thread

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. php errors galore
    By DMG Online in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 05-17-2008, 06:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers