473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

include error

I have a file that needs to include a file in the parent directory, and I am testing on a WinXP with apache, PHP, and mySQL installed, so I can test my scripts (localhost only)
In my htdocs/teq/PHP/Ses.php I have at the top:
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. include_once "../PHP/Ses.php";//this is including itself once
  3. ?>
and i get this error:
Warning: include_once(../PHP/Ses.php) [function.include-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\teq\PHP\Ses.php on line 2

Warning: include_once() [function.include]: Failed opening '../PHP/Ses.php' for inclusion (include_path='.;c:\php\includes;..;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\teq\PHP\Ses.php on line 2
if I change it to "./Ses.php" same error, and ../../teq/PHP/Ses.php and ../../Ses.php and so forth, but just Ses.php works fine
I have another file in teq/ta/Reg/register.php that includes ../../confs.php located at teq/confs.php that works with no error.

How can I solve this without using the full path?
Apr 27 '09 #1
2 1461
Tried PHP/Ses.php, and it worked, even though that implies it's in a diffrent dir.
WHY?
Apr 27 '09 #2
dlite922
1,584 Expert 1GB
@byteit101
the dot-dot (..) is a Unix/Linux-only system directory, Windows won't recognize it. The reason PHP works is because mostly that htdocs is in your PATH (see Widows Path system variable) that was added during apache install. It finds PHP then looks inside it for Ses.php (which happens to be your site's root dir)

I hope that's correct and somewhat of an explanation for you,

Good luck



Dan
Apr 28 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
9
by: Sarath | last post by:
I am working with an application using ASP, getting below error when i am trying to include new asp include file. _____________________________________________________________________ Microsoft...
10
by: Toke H?iland-J?rgensen | last post by:
Hello. I am quite new to the c++ language, and am still trying to learn it. I recently discovered how using include files would allow me to split up my code into smaller segments, instead of having...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
9
by: zolli | last post by:
Hi, I've been banging my head against this for a while now. Hoping someone here can shed some light on what's going on. On including stdlib.h in a file, I'm seeing the following errors: ...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
6
by: Jordi | last post by:
I'm having a problem which I think has to do with the circular use of inlcuding header files. The short version of my code would look a bit like this, I think: GameEngine.h: #ifndef GAME_ENGINE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.