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

Site for tips on server neutrality of PHP code?

I'm working on a site that's being developed on Apache/Linux and going to
be hosted on IIS/Windows. Anyone know of a site with good tips on possible
pitfalls, things to look for. Typical things I'll be looking to do that I
can see tripping me up include file upload, email, etc.

I'll be googling until then, but I thought I'd ask as well.

Preston
Jul 17 '05 #1
4 1745
Preston Crawford wrote:
I'm working on a site that's being developed on Apache/Linux and going to
be hosted on IIS/Windows. Anyone know of a site with good tips on possible
pitfalls, things to look for. Typical things I'll be looking to do that I
can see tripping me up include file upload, email, etc.


The super-global array $_SERVER does not have the same keys.
If you rely on $_SERVER['DOCUMENT_ROOT'], $_SERVER['SCRIPT_FILENAME'] (IIRC),
maybe others (I can check tomorrow) you'll have a nasty surprise when
you switch servers.
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #2
Pedro Graca <he****@hotpop.com> wrote in message news:<c3*************@ID-203069.news.uni-berlin.de>...
Preston Crawford wrote:
I'm working on a site that's being developed on Apache/Linux and going to
be hosted on IIS/Windows. Anyone know of a site with good tips on possible
pitfalls, things to look for. Typical things I'll be looking to do that I
can see tripping me up include file upload, email, etc.


The super-global array $_SERVER does not have the same keys.
If you rely on $_SERVER['DOCUMENT_ROOT'], $_SERVER['SCRIPT_FILENAME'] (IIRC),
maybe others (I can check tomorrow) you'll have a nasty surprise when
you switch servers.


I assume the same is true of $HTTP_SERVER_VARS? (I work on a project
that stays backwards compatible with PHP 4.0.6).
Jul 17 '05 #3
lawrence wrote:
Pedro Graca <he****@hotpop.com> wrote in message news:<c3*************@ID-203069.news.uni-berlin.de>...
The super-global array $_SERVER does not have the same keys.
If you rely on $_SERVER['DOCUMENT_ROOT'], $_SERVER['SCRIPT_FILENAME'] (IIRC),
maybe others (I can check tomorrow) you'll have a nasty surprise when
you switch servers.


I assume the same is true of $HTTP_SERVER_VARS? (I work on a project
that stays backwards compatible with PHP 4.0.6).


Yes, just tested it.

I've just run print_r($_SERVER) on both IIS and Apache.
As it is, what I said before is wrong (sorry everyone), both
[DOCUMENT_ROOT] and [SCRIPT_FILENAME] are available under both servers.
For my configuration this is what I found (unless I messed up again):

$_SERVER keys available under both servers
[DOCUMENT_ROOT]
[HTTP_*]
[PHP_SELF]
[QUERY_STRING]
[REMOTE_ADDR]
[REQUEST_METHOD]
[REQUEST_URI]
[SCRIPT_FILENAME]
[SCRIPT_NAME]
[SERVER_NAME]
[SERVER_PORT]
[SERVER_PROTOCOL]
[SERVER_SOFTWARE]

$_SERVER keys available under Apache but NOT IIS
[COMSPEC]
[GATEWAY_INTERFACE]
[PATHEXT]
[PATH]
[REMOTE_PORT]
[SERVER_ADDR]
[SERVER_ADMIN]
[SERVER_SIGNATURE]
[SystemRoot]
[WINDIR]

$_SERVER keys available under IIS but NOT Apache
[ALL_HTTP]
[APPL_MD_PATH]
[APPL_PHYSICAL_PATH]
[AUTH_TYPE]
[AUTH_USER]
[CONTENT_LENGTH]
[HTTPS]
[INSTANCE_ID]
[INSTANCE_META_PATH]
[LOGON_USER]
[ORIG_PATH_INFO]
[ORIG_PATH_TRANSLATED]
[PATH_INFO]
[PATH_TRANSLATED]
[REMOTE_HOST]
[REMOTE_USER]
[url]

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #4
Pedro Graca wrote:
Yes, just tested it.

I've just run print_r($_SERVER) on both IIS and Apache.
As it is, what I said before is wrong (sorry everyone), both
[DOCUMENT_ROOT] and [SCRIPT_FILENAME] are available under both servers.


That data is slightly misleading... I have a more comprehensive look at
PHP 4.3.4 on Apache 1.3.29 and PHP 4.3.3 on IIS 5.1 that I just created
for another project that I've been working on.

http://www.koivi.com/apache-iis-php-server-array.html

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
SEO Competition League: http://seo.koivi.com/
Jul 17 '05 #5

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

Similar topics

2
by: Benny Alexander | last post by:
Hi, We are developing a CMS in ASP and before we write the code for a complete site search script and Forum, we want to check if is there any good ones? Kindly please let us know. Thanks in...
2
by: Dhanraj K.S | last post by:
Hi All, Is there any Site search application which is extremely powerful. It would be a great help if some one can suggest! Thanks in advance,
3
by: Carol | last post by:
What's the best way to do a site search of my site? I am using asp and access heavily on a regular ISP google? Or write a bunch of queries? what else is there?
1
by: D. Lee Christopher | last post by:
Can anyone point me to a good tutorial for creating a site-level search applet? I am trying to create a virtual catalog of sorts, and I would like to be able to search the catalog and have the...
2
by: Shige | last post by:
I have a .Net website hosted on another IIS6.0. Whenever I tried to access my website after a long time, it will take forever to load, my browser will just show a blank white page and the progress...
2
by: Wells | last post by:
Debate Simmering in US Over Regulation of Internet A heated debate is shaping up in Washington about a concept some activists are calling Internet network neutrality, known more popularly as net...
48
by: northband | last post by:
Hi, I am interested in re-writing my website in Python vs PHP but have a few questions. Here are my specs, please advise as to which configuration would be best: 1.Dell Poweredge Server, w/IIS,...
3
by: Mark C | last post by:
Hi I was in the progress of developing a web site whereby developers can do free online tests on various programming languages. After initial feedback I managed to fix quite a few issues and...
15
by: dan | last post by:
I changed website hosts. The code that worked on my old host does not work on the new host. It appears that the php code is not running or running correctly. Nothing related to php is displaying....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.