SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    'include not found

    my include
    PHP Code:
    'db.inc.php' 
    is not being accessed. the apache error log tells me:
    "PHP Warning: include(db.inc.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11"
    I don't understand why it appears to be looking for the include file in the page i'm calling it from rather than the directory holding all my php files.
    and:
    "PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'db.inc.php' for inclusion (include_path='.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11

    I reckon it must be a setup problem in my ini file because this never happened before with my previous setup.

    Also, why does it refer to pear when i don't think i use that.

    thanks in advance, feeling a bit stupid,
    Mike

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    try using require().
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try to change to:
    Code:
    include_path=".;C:\php5\pear;C:\other\include\path"
    restart the server.
    my mobile portal
    ghiris.ro

  4. #4
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    require gets me:

    PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'db.inc.php' (include_path='.;C:\\php5\\pear') in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\xxxxxx\\xxxxxx.php on line 11

    why is my include_path going to pear, though. is that the problem. should i disable pear?

    cheers.

  5. #5
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    try using the full local path to the include.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  6. #6
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the include path should point to two include paths
    one for pear for pear include files
    second the normal include path
    ex: C:\php5\includes
    you have to create the includes directory in C:\php5
    my mobile portal
    ghiris.ro

  7. #7
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    changed the ini file restarted server, getting same fatal error referring to pear.

  8. #8
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post your include configuration in php.ini

    be sure the file is in the same directory where your php file is or the include path is correct

    or in the includes directory in C:\php5
    my mobile portal
    ghiris.ro

  9. #9
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    config is now pointing to c:\php\includes. makes no difference. have searched ini file for any reference to pear path without success. if i shift my include file from my site root then what would i do once i put the site onto my host? still don't undersdtand why this worked on my other pc Just checked the config on my other pc and the include_path isn't even de-commented. very odd.

  10. #10
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tried full path, arkinstall, and still not found.

  11. #11
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Just to check - What are the permissions on the file?
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  12. #12
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do i check that? sorry..

  13. #13
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Does the file even exist at the location you want?
    Ie does db.inc.php exist at this location:
    C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\xxxxxx\db.inc.php

    Also since you are on Windows, there is no permission settings.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  14. #14
    play of mind Ernie1's Avatar
    Join Date
    Sep 2005
    Posts
    1,252
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    add ;C:\php5
    to system advanced anvironment variables system variables path
    at the end of the variable value
    restart the system
    now the include path should work
    my mobile portal
    ghiris.ro

  15. #15
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If that is a pear package you will also need the directory where your pear files were downloaded to in your environmental path. As per ernies post, you should already have php in your path. You will need to follow the above advice and add the pear binaries path.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  16. #16
    SitePoint Zealot hephaistion's Avatar
    Join Date
    Oct 2006
    Location
    Polis Chrysochous, Cyprus
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    logic earth - yep, it exists on that path.

    to all - don't b distracted by me going on about pear. i just don't understand why pear is being referred to in the error message at all.

    this is the first time i've used apache rather than iis. could that be something to do with it? is there a default path? because i did not create any directory chp5.

    in the past i had no problem with my includes being in the same dir as my php pages. perhaps since apache is used so much with **nux they expect me to use a separate dir for includes?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •