Introduction to PHP >> Developing Code >> Conclusion
   
      To illustrate lets take the example of building an E-commerce project which runs both on Linux and Windows, talking optionally to either Microsoft SQL Server or MySQL. The software will be built with PHP4 and deployed on a Windows NT server under IIS and SQL server. It will also run equally happily (and somewhat faster) on Linux and MySQL.

The project objectives

     
To build a site for industrial use which would allow a database of products, prices and discount matrices to be accessed by registered users . The users should be able to place orders, review order status and carry out typical shopping-basket operations of the kind you would see on a many on-line ordering sites. Although the site wouldn't be allowed to connect to the live enterprise resource planning system (security concerns amongst some of the reasons) it would receive regular stock updates and should try to provide a good indication of current stock levels.

      The particular project objectives aren't all that important. The technically interesting aspects are the cross-platform solution that evolve.

      The main technical requirement is that any solution should be able to run equally well on Linux or Windows NT and that it should be independent of the database product as far as possible. A particular concern of the implementation was that the database would not be local to the web server, but instead accessed physically remotely via the corporate internal WAN. The WAN is known to have limited bandwidth and to get busy from time to time.

      Flexibility and portability being important matters, a solution based on either Perl or PHP would be the best bet. We have chosen PHP for various reasons.The main among them is its growing popularity.

Cross-Platform Issues

      Getting a copy of PHP and Mysql for both Linux and Nt is not a problem. Please goto php.net for the php download and mysql.com for mysql download.A proper installation of these would be very important. The manuals for the installation can also be got from their respective web sites.

      The first issue you would encounter would be persuading the Mysql to talk to the PHP code. We'd found that a) SQL Server talks the same protocol as Sybase (no surprise, since SQL Server is/was based on a Sybase core) and that b) we would need some special libraries to make it work. Those libraries are not part of standard PHP distributions for Linux/Unix. Freetds library is a good option.

Eventually PHP4 running on Linux was talking to SQL Server running on NT.

Related Topics: Developing Code >> Conclusion

 
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
© 2003-2004 CYBERKRAFT TECHNOLOGIES. ALL RIGHTS RESERVED.