473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting scripts to run on PHP 5 with Windows NT

DH
I normally develop PHP projects on a Windows PC (WAMP) and then upload
the stuff to Linux/Apache/MySQL4.x/PHP4.x

Now I have to install a content management system on PHP 5 where the
server is Windows NT CS-PORTAL 5.2. The client owns the server, and
refuses to open a commercial web hosting account (as do all my other
clients).

phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
wondering how many changes I'm going to have to make in my CMS in order
to get it to run on an NT server?

TIA. My news client crashed while posting this the first time. Please
excuse any resulting double-post.

Jul 17 '05 #1
3 1942
nc
DH wrote:

I have to install a content management system on PHP 5 where
the server is Windows NT CS-PORTAL 5.2. The client owns the
server, and refuses to open a commercial web hosting account
(as do all my other clients).

phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has
me wondering how many changes I'm going to have to make in my
CMS in order to get it to run on an NT server?


Exactly two.

1. Run grep (or another search and replacement utility) and
change all occurences of $_SERVER['DOCUMENT_ROOT'] in your
code to a configuration variable, say, $docroot.

2. In your configuration file (you probably have one),
define the $docroot:

$docroot = $_SERVER['DOCUMENT_ROOT'];

This will be your default definition you will use for all
your clients. For the client you are having trouble with,
change this line manually to something like:

$docroot = 'C:/Inetpub/www';

Alternatively, check the output of phpinfo(); there may
be something usable in the $_ENV variable...

The lesson: don't expect environment variables to be there.
You don't know where your software may end up tomorrow. Set
defaults using environment variables, but be open to changing
settings during implementation. ..

Cheers,
NC

Jul 17 '05 #2
"DH" <do*****@comcas t.net> wrote in message
news:sc******** ************@co mcast.com...
I normally develop PHP projects on a Windows PC (WAMP) and then upload
the stuff to Linux/Apache/MySQL4.x/PHP4.x

Now I have to install a content management system on PHP 5 where the
server is Windows NT CS-PORTAL 5.2. The client owns the server, and
refuses to open a commercial web hosting account (as do all my other
clients).

phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
wondering how many changes I'm going to have to make in my CMS in order
to get it to run on an NT server?


Dunno, do you habitually use absolute paths in your programming?


Jul 17 '05 #3
"DH" <do*****@comcas t.net> wrote in message
news:sc******** ************@co mcast.com...
I normally develop PHP projects on a Windows PC (WAMP) and then upload
the stuff to Linux/Apache/MySQL4.x/PHP4.x

Now I have to install a content management system on PHP 5 where the
server is Windows NT CS-PORTAL 5.2. The client owns the server, and
refuses to open a commercial web hosting account (as do all my other
clients).

phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
wondering how many changes I'm going to have to make in my CMS in order
to get it to run on an NT server?

TIA. My news client crashed while posting this the first time. Please
excuse any resulting double-post.


Is your client willing to install Apache 2? From my own experience PHP is
always somewhat flaky on IIS.

But to answer your question, it wouldn't be that hard to get it to work on
IIS. The following are variables provided by the ISAPI module:

"AUTH_PASSWORD" ,
"AUTH_TYPE" ,
"AUTH_USER" ,
"CONTENT_LENGTH ",
"CONTENT_TY PE",
"PATH_TRANSLATE D",
"QUERY_STRI NG",
"REMOTE_ADD R",
"REMOTE_HOS T",
"REMOTE_USE R",
"REQUEST_METHOD ",
"SERVER_NAM E",
"SERVER_POR T",
"SERVER_PROTOCO L",
"SERVER_SOFTWAR E",
"APPL_MD_PA TH",
"APPL_PHYSICAL_ PATH",
"INSTANCE_I D",
"INSTANCE_META_ PATH",
"LOGON_USER ",
"REQUEST_UR I",
"URL",

Not on the list are DOCUMENT_ROOT, SCRIPT_NAME, and SCRIPT_FILENAME .
Jul 17 '05 #4

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

Similar topics

0
1067
by: secun | last post by:
I've written some python scripts to handle different tasks on my Windows network. I would like to have them accessible via a single web page (kind of like a dashboard) and have the scripts run on the server on which the web server resides (also a Windows box) This is an internal server only, but the scripts need to be secure since the...
1
2145
by: George van den Driessche | last post by:
Hi folks, I'm looking at packaging a project I'm working on using distutils. The project is for Windows and contains a COM server which needs registration, so the installer needs to be a little more complicated than usual. Looking at the options for the bdist_wininst command to distutils, I see it's possible to specify...
1
7995
by: David Chase | last post by:
I am trying to retrieve the LOGON_USER and it comes up blank. Below is my code: struser = Request.ServerVariables("LOGON_USER") Can anyone help? I need to validate internal people on out intranet. Thanks. David
6
13987
by: john_williams_800 | last post by:
Hi; I am writing an html page that will live on one server in an ms windows network, but access pictures from a directory on another ms windows server in the network. I know in html the values for img src use unix style path separators with root ( "/" being your parent web directory. However in windows land the path to my images would...
0
1328
by: JR | last post by:
Here's the scenerio: HAD: Entire Windows 2000 domain multiple servers Internal Web Server - Windows 2000 NAS Server - Windows 2000 Internal Web Application (On Web server) utilizing .ASP scripts to access shared directories through mapped drives on NAS Server. (And yes, I know UNC paths should have been used, but I didn't actually
3
1570
by: asearle | last post by:
Hi everyone, I have a connection of Oracle SQL scripts which I currently run with Oracle SQL*Plus (the Oracle command-line tool). Now I would like to make these scripts more 'dynamic' and would like to implement them with Perl DBI. I am working with Windows (XP), have installed ActivePerl 5.8.8 and have found stacks of expamples in the...
18
2018
by: W. Watson | last post by:
What do I download to use Python with MX XP Pro on an ASUS 4 year old motherboard? I would guess a good book source for starters would be the O'Reilly book. Wayne T. Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet ""I do not fear...
11
5999
by: geoffbache | last post by:
Hi, As part of my efforts to write a test tool that copes with GUIs nicely, I'm trying to establish how I can start a GUI process on Windows that will not bring up the window. So I try to hide the window as follows: info = subprocess.STARTUPINFO() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW info.wShowWindow = subprocess.SW_HIDE
0
945
by: Yansky | last post by:
Hi, I'm having a lot of problems getting any Python scripts to run on my website. I have put them in the cgi-bin directory and chmodded both the directory and files to 755. But when I try to access the script, I get a 404 error: http://forboden.com/cgi-bin/wp.py I also tried running them from another directory and giving the directory its...
1
3812
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi mister, I have an Winforms app (Client) and Web app + WCF Services + Windows Services (Server). In server, I have installed SQL SERVER 2000. Now, I want create a installer (MSI.exe or another Winforms app) to create a database, perhaps user, tables, stored procedures, .. Only the user introduces name of database, server, and if has...
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3840
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.