开发者

Move to php in windows? Concern, hints, "please don't do!"?

I am considering to move frome Microsoft languages to PHP (just for web dev) which has quite an interesting syntax, a perlish look (but a wider programmer base) and it allows me to reuse the web without reinventing it. I have some concerns too. I would be more than happy to gather some wisdom from stackoverflow community, (challenge to my opinions warmly welcome). Here are my doubts about using PHP on IIS web server on windows server .

  1. Efficiency. Cgi are slow, what I am supposed to use? Fastcgi? Or what else?
  2. Efficiency + stability. Is PHP on windows really stable and a good choice in terms of performances?
  3. Database. I use very often MSSQL (I regret, i like it). Could I widely and efficiently interface PHP with MSSQL (using smartly stored pro, for example).
  4. XSLT + XML performance. I work quite a lot with XML and XSLT and I really find the MS xml parser a great software component. Are parser used in PHP fast, reliable and efficient (I am interested mainly in DOM, not SAX)?
  5. Objects. Is the PHP object programmi开发者_JAVA百科ng model valid end efficient? 6 Regex. How efficient is PHP processing regexp?

Many thanks for your advices.


Efficiency. Cgi are slow, what I am supposed to use? Fastcgi? Or what else?

PHP runs as Apache module so there is no need for FastCGI.

Efficiency + stability. Is PHP on windows really stable and a good choice in terms of performances?

Personally i wouldn't use PHP on Windows but my experience shows that there is no big difference to Linux & PHP

Database. I use very often MSSQL (I regret, i like it). Could I widely and efficiently interface PHP with MSSQL (using smartly stored pro, for example).

PHP can access MSSQL via ODBC or via the native MSSQL extension. You might want to look into PostgreSQL though.

XSLT + XML performance. I work quite a lot with XML and XSLT and I really find the MS xml parser a great software component. Are parser used in PHP fast, reliable and efficient (I am interested mainly in DOM, not SAX)?

No experience there, sorry.

Objects. Is the PHP object programming model valid end efficient?

Since PHP 5 (especially 5.3) Object oriented programming in PHP is acceptable. It supports everything most other languages support, inheritance, interfaces, overloading, ...

Regex. How efficient is PHP processing regexp?

PHP uses the PCRE library afair so there shouldn't be much difference to other languages.

All in all:
I'm no fan of PHP, i greatly prefer languages with strong types like C/C++/C#/Java but for a scripting language PHP made huge improvements to the PHP we knew a few years ago. If you stick to object oriented programming PHP can be a clean and good language. The main drawback is:
PHP has no object oriented base, i.e. no string class, it uses C-like functions (strchr, strstr, strlen, ...), this makes OOP harder, you have to have more discipline to develop good code.


You should also consider cost. PHP + MySQL doesn't cost big money like building on top of a Microsoft stack (Asp.net + SQL Server + Windows Server). Hello licensing fees!


If you are doing PHP and considering MySQL you might as well be on a LAMP stack.


  1. That depends on which web server you are using (or want to use). In Apache you can embed PHP as a module, which is faster than CGI. I'm not sure whether this can be done with IIS too.
  2. I have been using PHP on Windows for about 6 years now, it has never crashed; of course there are the usual infinite loops, but restarting the web server is always sufficient. Also, the efficiency and stability are more related to the web server than to the operating system.
  3. Yes, see: http://nl2.php.net/mssql
  4. For DOM there is: http://php.net/manual/en/book.dom.php I don't know how it compares in performance with other XML parsers, I mainly use the SimpleXML http://nl3.php.net/simplexml parser. XSLT is a bit outdated in PHP, it only supports version 1.0: http://nl2.php.net/manual/en/book.xslt.php
  5. PHP has a good Object Oriented programming model; it supports classes, interfaces, statics, exceptions, reflection, etc. But as it is a scripting language it lacks strong typing.
  6. See: http://nl3.php.net/manual/en/ref.pcre.php


In answer to question 3 - yes, you can easily connect to mssql dbs using PHP. Read more in the PHP manual - http://php.net/manual/en/ref.mssql.php or use an abstraction layer like Pear::MDB2 - http://pear.php.net/manual/en/package.database.mdb2.intro.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜