473,467 Members | 1,645 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Required files confused between applications on same server

Ray
Hi all,

I'm running PHP 5.2.0 on my Windows XP laptop, running under IIS. I
have files named 'config.php' in two different web applications on
this machine, which are included throughout each via 'require' in one
and 'require_once' in the other.

When I attempt to use the two applications simultaneously, the file
which was 'require_once'-ed is also being accessed from the other
application, even though the two applications are isolated from each
other in IIS, and are in completely different directories on the
computer.

Has anyone come across this before? Is it a known bug?

Thanks,

Ray.

Jul 28 '07 #1
3 1303
Rik
On Sat, 28 Jul 2007 20:32:47 +0200, Ray <ro*@iol.iewrote:
Hi all,

I'm running PHP 5.2.0 on my Windows XP laptop, running under IIS. I
have files named 'config.php' in two different web applications on
this machine, which are included throughout each via 'require' in one
and 'require_once' in the other.

When I attempt to use the two applications simultaneously, the file
which was 'require_once'-ed is also being accessed from the other
application, even though the two applications are isolated from each
other in IIS, and are in completely different directories on the
computer.

Has anyone come across this before? Is it a known bug?
Normallly, PHP checks a full path afaik, but I have no experience with IIS

Is the full path in get_included_files() or isn't it? And are you calling
it by the full path or not? Perhapse it's an include_path issue. Then
again, it might be as simple as a relative call in on of the applications
which doesn't turn out OK, because it makes wrong assumptions about the
current working directory, in which case they should be fixed.
--
Rik Wasmus
Jul 28 '07 #2
Ray
On Jul 29, 5:14 pm, Rik <luiheidsgoe...@hotmail.comwrote:
On both. PHP has a 'current working dir', the files are searched in the
include_path, wich usually holds '.' (the current working directory), and
possibly others. This current working dir is not the directory of the file
that asks for an include/require, but usually where the process started.
It can be quite confusing when including several files, so to check what
the dir is you can use get_cwd();
OK, I'm starting to understand. I've experimented a bit, and when I
access the first app, getcwd() returns c:\windows\system32. However, I
then access the other app, and then when I go back to the first, the
working directory has changed to the root of the second app!

I don't yet understand why the second changes the working directory,
while the first doesn't....the only difference between them is that
the first uses require() while the second uses require_once().

Ray.

Jul 29 '07 #3
Rik
On Sun, 29 Jul 2007 18:48:58 +0200, Ray <ro*@iol.iewrote:
On Jul 29, 5:14 pm, Rik <luiheidsgoe...@hotmail.comwrote:
>On both. PHP has a 'current working dir', the files are searched in the
include_path, wich usually holds '.' (the current working directory),
and
possibly others. This current working dir is not the directory of the
file
that asks for an include/require, but usually where the process started.
It can be quite confusing when including several files, so to check what
the dir is you can use get_cwd();

OK, I'm starting to understand. I've experimented a bit, and when I
access the first app, getcwd() returns c:\windows\system32. However, I
then access the other app, and then when I go back to the first, the
working directory has changed to the root of the second app!

I don't yet understand why the second changes the working directory,
while the first doesn't....the only difference between them is that
the first uses require() while the second uses require_once().
Impossible to tell without the code (and I must confess I try to stay
clear of IIS), but a simple chdir() will offcourse change the working dir.

--
Rik Wasmus
Jul 29 '07 #4

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

Similar topics

11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
7
by: Ravi J | last post by:
What is the best way to transfer files between two .NET executables? I have a service, and a client program. Client asks service for data. The service creates one, and passes it back to client....
8
by: Dominic Martin | last post by:
Hi, I need to setup an ODBC link over our Internet connection between MS Access (local) and a MySQL server (Remote - the local PC has the MySQL ODBC driver installed). What kind of bandwidth...
1
by: Steve M | last post by:
I have server that has the 1.1 .NET Redistributable Framework on it. But it does not run ASP.NET applications. It will load the page, but only displays the HTML part of the page. The app works...
2
by: Sean | last post by:
I have an ASP.NET web application that needs to be rolled out to a number of clients. The functionality is the same in all applications, but each client has its own database. At the moment, I...
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user...
0
by: Astra | last post by:
Hi All Wondered if you could help. I've created a web site system that a number of users use on their sites, but I manage each individual site/system on my ISP's server. Creating updates to...
3
by: Brian | last post by:
Hi First off, if I am not meant to post requests for this on these newsgroups I am sorry. I did try to find some groups that were more suited but couldn't find any. I am looking for somebody...
6
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to...
0
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
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
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
1
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
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
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.