This is a discussion on getting scripts to run on PHP 5 with Windows NT within the PHP Language forums, part of the PHP Programming Forums category; I normally develop PHP projects on a Windows PC (WAMP) and then upload the stuff to Linux/Apache/MySQL4.x/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
"DH" <doug861@comcast.net> wrote in message
news:sc6dnQSlddDNV3_cRVn-hg@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? |
|
|||
|
"DH" <doug861@comcast.net> wrote in message
news:sc6dnQSlddDNV3_cRVn-hg@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. |