Google Answers Logo
View Question
 
Q: using PHP/MySQL with Windows 2000 ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: using PHP/MySQL with Windows 2000
Category: Computers > Internet
Asked by: g8z-ga
List Price: $10.00
Posted: 07 Feb 2003 12:45 PST
Expires: 09 Mar 2003 12:45 PST
Question ID: 158561
Hello,
My company has a Windows 2000 server and it has been proposed by some
IT consultants who we are working with to use Apache/MySQL/PHP intead
of IIS/SQLServer/ASP that comes with Windows 2000 server to develop
our company's website. I just have some questions about using these
technologies on Windows 2000...

1. MySQL and PHP builds on W2000 ...

a. Are the most current builds of mySQL and PHP able to run stably on
Windows 2000?

b. If there are reported problems with mySQL/PHP and Windows 2000 (and
there must be some) what are they?


2. Apache vs IIS (w/ W2000 and mySQL/PHP) ...

a. Do the most recent builds of Apache run on Windows 2000 (I have
heard they don't)? What are the known issues?

b. Does mySQL/PHP run well using Microsoft's IIS, or only Microsoft
stuff runs well with IIS?


3. Are there any other pitfalls to avoid on W2000? How can they be
avoided?
Answer  
Subject: Re: using PHP/MySQL with Windows 2000
Answered By: mrbuzz-ga on 07 Feb 2003 17:55 PST
Rated:5 out of 5 stars
 
Greetings again g8z,

I guess what all this boils down to is whether you feel that your
investment in purchasing the Windows 2000 Server license will have an
effect on your final decision, especially if you’ve already purchased
MS SQL Server as well.

While the Apache/MySQL/PHP combo will work and works well on Windows
2000, I would still recommend running them on a Linux-based operating
system.  This is especially important if you plan to download and use
existing PHP solutions.  Quite a lot of PHP scripts are designed
natively for use with Linux and some rely on Linux console
applications to perform certain tasks.

That being said, here are my responses to each of your questions.

> 1. MySQL and PHP builds on W2000 ... 
> a. Are the most current builds of mySQL and PHP able to run stably
on Windows 2000?

As an administrator of a web hosting firm, where I work, we have used
the latest production versions of MySQL (3.23.xx) and PHP (4.3.0)
without reliability problems on Windows 2000 and beta builds of Server
2003 with IIS.  Most of our Windows IIS servers are configured to use
all of the following simultaneously: ASP, ASP.NET, PHP, Perl, MSSQL
and MySQL.

> b. If there are reported problems with mySQL/PHP and Windows 2000
(and there must be some) what are they?

For PHP, it’s mainly an installation issue and choosing whether to use
PHP as an ISAPI extension or as a CGI executable.  The CGI interface
is more stable since each instance runs in its own memory space where
as the ISAPI is a multithreaded extension, although faster but there
have been reported problems with concurrency issues and strange errors
after prolonged periods of use.  The CGI interface runs under a
different user than the IUSR_computername so it has security issues
especially with File I/O.  Where I work, we’re using it in CGI mode
with PHP open_basedir restrictions in place so it’s fairly safe for
general purposes.  The biggest downside of PHP on IIS is that certain
PHP scripts rely on Linux commands as mentioned above so they either
don’t work as well in a Windows environment or they give strange
errors not typically seen on their Linux counterparts.

For MySQL, in previous versions, there have been issues of stability,
especially with transaction processing and large amounts of concurrent
users, however, we haven’t had any problems with 3.23.xx thus far. 
You can see more notes on this at (
http://www.mysql.com/doc/en/Windows_vs_Unix.html ).  The main
disadvantage of MySQL is if you use any ODBC-based server
applications.  The MyODBC connector for MySQL have been known to cause
connectivity problems such as dropped connections, however if you
don’t rely on any ODBC applications, this wouldn’t be an issue.
 
> 2. Apache vs IIS (w/ W2000 and mySQL/PHP) ... 
 
> a. Do the most recent builds of Apache run on Windows 2000 (I have
heard they don't)? What are the known issues?

I have installed Apache on Windows 2000 and there were no significant
problems in serving files.  Apache on Windows 2000 is comparable to
Apache on Linux in terms of reliability.  The problems you’ve heard
most likely deals with the fact that Apache 2.0.xx still has some
issues when used with PHP 4.2.x or 4.3.  For this, I suggest using the
latest production builds of Apache 1.3.xx instead if you wish to use
it with PHP.  The more recent builds of both Apache 2.0.xx and PHP do
get along although the PHP module appears to only work reliably in CGI
mode as opposed to running it as a Apache SAPI module typically used
on Linux.
 
> b. Does mySQL/PHP run well using Microsoft's IIS, or only Microsoft
stuff runs well with IIS?

As I have mentioned above, we’ve used MySQL/PHP for a few months using
both PHP 4.2.xx and 4.3, and have worked quite nicely under IIS.  If
configuring Apache’s httpd.conf files are too daunting, IIS with PHP
hasn’t been a problem.
 
> 3. Are there any other pitfalls to avoid on W2000?  How can they be
avoided?

Mainly, managing NTFS security permissions will prove to be a common
issue.  Since depending on how you run PHP under IIS (CGI or ISAPI),
you will need to configure the NTFS permissions accordingly. 
Generally, the sessiondata and the uploadtemp must be marked for Write
permissions for NTFS.  Just configuring them for Write under IIS will
not be enough.

The main issue for MySQL is that there is no easy administrative
interface comparable to the power of SQL Server’s Enterprise Manager. 
PHPMyAdmin will work fine on Windows 2000, however, you will find that
PHPMyAdmin for MySQL will leave quite a lot to be desired when
compared to Enterprise Manager for MS SQL Server.  At least that’s how
I feel whenever I’m manipulating or designing tables in PHPMyAdmin. 
Though, don’t get me wrong, PHPMyAdmin is probably the best script out
there for administering MySQL and I’m glad to be able to provide it as
a service to my company’s clients.

Overall, I’d say that going with an IIS/PHP/MySQL solution should be
easily accomplished.  You will need to tweak php.ini a bit to suit
your development environment, especially if you’re hosting clients
other than your company’s own website.  The main reason I suggested
using IIS over Apache is that if you ever plan to use ASP, the
functionality would already exist.  Also, especially if you’ve never
configured Apache before, editing virtual hosts, httpd.conf files and
setting .htaccess permissions can be quite intimidating to say the
least, especially if you’ve used IIS primarily in the past.  IIS
leaves the door open for .NET development should your company choose
to use that in the future.

I hope this gives you a general idea of some of the issues surrounding
these applications/technologies.  Please let me know if you need
clarification on any of the above.

Thanks,
mrbuzz-ga


Additional information:

Apache 2.0.42/PHP 4.3 issues
http://forums.devshed.com/archive/15/2002/10/1/44560

Installing Apache 2 and PHP 4.2 on Windows
http://www.flash-db.com/Board/index.php?board=19;action=display;threadid=1399

PHP as CGI vs ISAPI
http://forums.devshed.com/archive/5/2001/06/4/17440

MySQL Windows vs Unix
http://www.mysql.com/doc/en/Windows_vs_Unix.html

Search strategy:
://www.google.com/search?q=apache+2%2E0+php+problems
://www.google.com/search?q=mysql+windows+issues
://www.google.com/search?q=php+cgi+isapi
://www.google.com/search?q=php+iis+problems
http://groups.google.com/groups?q=mysql+windows+issues

Request for Answer Clarification by g8z-ga on 07 Feb 2003 18:45 PST
"The MyODBC connector for MySQL have been known to cause
connectivity problems such as dropped connections, however if you
don’t rely on any ODBC applications, this wouldn’t be an issue."

--> There's a chance that we'll be using Apple's WebObjects (which
works under Windows 2000) with MySQL. Do you know of any issues
relating to reliability of WebObjects and MySQL on a Win2K server?
Would this fall under the category of ODBC applications?

"The biggest downside of PHP on IIS is that certain
PHP scripts rely on Linux commands as mentioned above so they either
don’t work as well in a Windows environment or they give strange
errors not typically seen on their Linux counterparts."

--> Are you referring to things like CHMOD? If using Win2K, would
directory persmissions then have to be set manually or is there a way
to programmatically set NTFS permisssions in PHP? Also, do server
commands like those gotten when using the backtick operator ` work
when using PHP under Win2K? E.g. `dir`

Request for Answer Clarification by g8z-ga on 07 Feb 2003 19:06 PST
A couple more questions:

Regarding .NET, most of the computers on the network are Macs. Do you
know if the .NET framework has been ported to Mac, and if so, is it
reliable?

Do the PHP mail functions work under Win2K + IIS (e.g. using Exchange
2000)?

Clarification of Answer by mrbuzz-ga on 07 Feb 2003 20:49 PST
I did a bit of searching on WebObjects.  It uses a JDBC connector as
opposed to an ODBC connector.  From what I've read in the
documentation, WebObjects appears to work as a CGI object or ISAPI
extension on its own and supports MySQL as a database connector (
http://developer.apple.com/techpubs/webobjects/WebObjects_5.1/PostInstall/EOAdaptors/Installing__se_Adaptors.html
).  You will need a JDBC connector for MySQL (
http://mmmysql.sourceforge.net or
http://www.mysql.com/downloads/api-jdbc.html ).  Although I'm not
familiar with WebObjects, it appears that it should run fine under IIS
as either a CGI application or an ISAPI (
http://developer.apple.com/techpubs/webobjects/WebObjects_5.1/PostInstall/WebAdaptors/Microsoft_IIS_ISAPI_.html
).

I wasn't able to locate any reliability info specific to WebObjects
w/MySQL on Windows 2000.  My guess is that since it runs on a Java
platform, as long as the Java virtual machine is stable (I would
recommend latest version of Sun’s JDK in this case), WebObjects should
be stable as well, although I have no concrete evidence to support
this theory.  Since WebObjects is designed to run on Windows and under
IIS as well as supporting MySQL as a database engine, I think it
should be alright.

As for PHP scripts relying on Linux commands, yes CHMOD and the like
would be among them.  Others may rely on responses from shell
applications such as ‘dmesg’ or ‘uname’ or even something like ‘date’
or ‘uptime’.  Though, most PHP scripts you encounter will say whether
they’re supported on Windows, or if they’re platform independent.  On
Windows 2000, if you host the PHP scripts outside of Inetpub, you may
encounter permission problems.  Generally, just adding read
permissions for IUSR should be enough.  As far as I know, you cannot
use PHP to set NTFS permissions since generally the user credentials
that PHP runs under does not have enough permissions to set anything.

Regarding the backtick operator and the shell_exec() function, it
appears to work according to some of the responses at (
http://www.php.net/manual/en/function.shell-exec.php ).  Though, I’ve
just tried this on one of the servers and was unable to get it to
work.  It kept spitting back “Warning: shell_exec()
[function.shell-exec]: Unable to execute 'cmd /c tasklist.exe' in
C:\Inetpub\miscroot\test\test.php on line 2”.  Although the server’s
php.ini file is secured quite heavily, so it’s probably due to that.

Now, with .NET Framework on Mac, Microsoft does not appear to have
plans to make a Mac OS X version of it available.  So, you’ll probably
have to rely on 3rd party ports such as iNET (
http://www.stryon.com/products.asp?s=4 ), one of the first
implementations of .NET Framework on Mac using Java.  It is currently
in beta, though it is available for download.  An article on MacWorld
summarizes the product nicely (
http://maccentral.macworld.com/news/0203/14.inet.php ).  I’ve looked
around for awhile but I have been unable to locate discussions on the
iNET implementation and associated problems/issues.

PHP’s mail function uses standard SMTP protocols.  I’m not very
familiar with Microsoft Exchange but it does have standard SMTP
modules so it should be fine.

Let me know if you need any additional clarification.

Thanks,
mrbuzz-ga
g8z-ga rated this answer:5 out of 5 stars
Excellent followup to my clarification requests. Great job!

Comments  
Subject: Re: using PHP/MySQL with Windows 2000
From: legomaniac-ga on 08 Feb 2003 11:38 PST
 
I ran across this little package a long time ago that might be
helpful.
There's an All-in-One installation package for Windows platforms
called EasyPHP (http://www.easyphp.org)

It contains:
Apache 1.3.24
PHP 4.2.0
mySQL 3.23
phpMyAdmin 2.2.6

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy