By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,748 Members | 1,570 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,748 IT Pros & Developers. It's quick & easy.

Site for tips on server neutrality of PHP code?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.