473,383 Members | 1,872 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,383 software developers and data experts.

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 1927
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*****@comcast.net> wrote in message
news:sc********************@comcast.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*****@comcast.net> wrote in message
news:sc********************@comcast.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_TYPE",
"PATH_TRANSLATED",
"QUERY_STRING",
"REMOTE_ADDR",
"REMOTE_HOST",
"REMOTE_USER",
"REQUEST_METHOD",
"SERVER_NAME",
"SERVER_PORT",
"SERVER_PROTOCOL",
"SERVER_SOFTWARE",
"APPL_MD_PATH",
"APPL_PHYSICAL_PATH",
"INSTANCE_ID",
"INSTANCE_META_PATH",
"LOGON_USER",
"REQUEST_URI",
"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
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...
1
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...
1
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...
6
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...
0
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...
3
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...
18
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,...
11
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...
0
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.