473,503 Members | 9,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error says can't see include file, yet executes some code on include file

PI
Hi guys, I need some urgent help here please:
I am using an include_once() command to include a file that sits a
level above the file view.php. when the code is run, I have an error
as follows:

Warning: include_once(../common.php) [function.include-once]: failed
to open stream: No such file or directory in C:\Program Files\..
\view.php on line 2

Warning: include_once() [function.include]: Failed opening '../
common.php' for inclusion (include_path='.;C:\Program Files\xampp\php
\pear\') in C:\Program Files\...\view.php on line 2

The include command is simply: include_once(../common.php) - the '../'
before the 'common.php' to indicate a level above the current file
level. Is this right? I could not find a resource to confirm this.

The strange thing is that while the error seems to imply that the
calling file, view.php cannot 'see' the common.php file, other
functions called from the 'common.php' file executes correctly and on
the same calling file/page (view.php).

Appears to the a double take - quite confusing - a PHP newbie and I'd
appreciate your prompt response, thanks

Feb 2 '07 #1
1 1778
PI wrote:
Hi guys, I need some urgent help here please:
I am using an include_once() command to include a file that sits a
level above the file view.php. when the code is run, I have an error
as follows:

Warning: include_once(../common.php) [function.include-once]: failed
to open stream: No such file or directory in C:\Program Files\..
\view.php on line 2

Warning: include_once() [function.include]: Failed opening '../
common.php' for inclusion (include_path='.;C:\Program Files\xampp\php
\pear\') in C:\Program Files\...\view.php on line 2

The include command is simply: include_once(../common.php) - the '../'
before the 'common.php' to indicate a level above the current file
level. Is this right? I could not find a resource to confirm this.

The strange thing is that while the error seems to imply that the
calling file, view.php cannot 'see' the common.php file, other
functions called from the 'common.php' file executes correctly and on
the same calling file/page (view.php).

Appears to the a double take - quite confusing - a PHP newbie and I'd
appreciate your prompt response, thanks
Among other things - since it's a string, you need quote marks around
the filename - i.e.

include_once('../common.php'); // double quotes also work

Is this a web page or a cli program?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2384
by: Bill Cohagan | last post by:
I'm writing a console app in c# and am encountering a strange problem. I'm trying to use redirection of the standard input stream to read input from a (xml) file. The following code snippet is from...
12
801
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions...
1
3329
by: Tim Mulholland | last post by:
Hopefully someone can point out what is going on here. I'll give a short explanation first, then a more detailed one at the bottom if anyone wants to dig into it more. I have a strongly-typed...
10
2681
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
2
4420
by: Keith Kowalski | last post by:
I anm opening up a text file reading the lines of the file that refer to a tif image in that file, If the tif image does not exist I need it to send an email stating that the file doesn't exist...
5
10787
by: Nathan Sokalski | last post by:
I have an ASP.NET application which is giving the following JavaScript error: 'theForm' is undefined However, when I do a View Source one of the <scriptelements is as follows: <script...
13
3788
by: Albert | last post by:
Hi I'm using the lcc compiler for win32. I tried compiling a program but there's an error stating: "cpp: Can't open input file clrscr()" I don't get it - I've included <tcconio.h>. (strange why...
1
2793
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
2
2583
by: kkshansid | last post by:
this is my search page on which i am getting two parameters from previous page but the problem is that as soon as i click any other next pages my sql query fails as it doesnt get these two parameters...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.