Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Php Install

Php Install

Ratings: (0)|Views: 169 |Likes:
Published by Abdulraheman

More info:

Published by: Abdulraheman on Jun 04, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Building a PHP 5 Web Server on Windows IIS
With the recent release of PHP 5.0, many PHP developers mightbe thinking about upgrading their existing PHP installations to the newstandard. Although PHP 5.0 may not be ready yet for a live environment, thistutorial will show you how to build a PHP 5.0 server on Windows that would besuitable for hosting live applications with future builds of PHP 5.x.In general, a "dot zero" version of a new system has not been tried and testedenough to be considered safe for production servers. With an application ascomplex as PHP 5.0, it is an absolute certainty that bugs will be found, andcorrected promptly, within the coming months. I would expect a 5.0.1 version tobe released shortly, which may prove to be stable enough for live servers.In the following tutorial, I will be working with the following software:Windows 2000 Professional: I consider this to be the best version ofWindows that MS ever produced, I am using SP 3. These instructions should alsobe appropriate, with some variations for IIS configurations, for Windows XP Pro,Windows 2000 Server and Windows 2003 Server, but not Windows XP Home that is nota proper network enabled operating system, and should be avoided at all costs!Important Note: It is important to realise that IIS on Windows2000 Pro has built-in 10 user connection maximum limit; as a result you shoulduse Windows 2000 Server for a live server, but Windows 2000 Pro or Windows XPPro should work fine for a test server. Thanks to Brian O'Flaherty for thisinformation.IIS 5: This comes on the Windows 2K CD; you can also use 5.1 or 6depending upon which operating system you are using. I am using IIS rather thanApache 2 because IIS allows us to use pass through authentication in our PHPapplications (I will cover this in detail later), and generally believe thatApache belongs on Unix/Linux for production servers; while if you must useWindows for a web server, you might as well use IIS too!MySQL 4.1.3 Beta: As of writing, this is still beta so should not be usedon a live server. I have been using it for the last couple of months, and foundit to be quite stable; therefore I believe that MySQL 4.1 will be released as anofficial version soon. 4.1 provides some major improvements over 4.0.x, such assub queries, so I would recommend this version strongly.PHP 5.0.0 Win 32: It goes without saying; you should download the Windowsversion of PHP. I will be doing a manual build, so download the zip packageinstead, rather than the Windows installer which only provides a basic installof PHP 5.0.PEAR::DB 1.6.5: I will be using the version of PEAR that comes with PHP5.0, and downloading and installing DB 1.6.5, the PEAR database abstraction API(I will explain all this later).Aspell 0.50.3 and Aspell en 0.50.2: This application, along with therelevant English dictionary (other languages are also available), allow us touse spell checking functions in our PHP 5.x applications. FPDF 1.52: This is thefree PDF generating class that we will use in our PHP 5.x applications togenerate PDF document on the fly.If you have never heard of some of these packages, don't worry I will explaineach one in turn before I describe how to install them. In general with theseinstallation tutorials, your system and version numbers will not exactly matchmine, so there may be different options or steps required to get yourconfiguration up-and-running, but hopefully these guidelines will provide allthe instructions you need.You will find a section of links at the bottom of this page to the downloadsites for all of the software you need to setup your server. Download the latestversions of everything you need (I estimate about 50 MB in total for alldownloads), save them to a local folder on your C drive, then you are ready to
begin.2. Installing IISon Windows 2000The first thing we need to do is set up IISfrom our Windows 2K CD. IIS (Internet Information Service) is Microsoft'sequivalent of Apache, a HTTP server that will run on your PC, listening to anetwork port (by default port 80) on your machine for HTTP requests, andresponding to these requests, normally requests for HTML pages, by sending theHTML page to the client machine looking for the data.You could use Apache 2.x, or some other web server, for this step instead, but Ido not discuss Apache sever configuration options at any stage so you might getlost. I use a LAMP (Linux Apache MySQL PHP) test server at home, and Windows IISservers in work, so am comfortable with either environment. Therefore, I maypublish a tutorial on setting up a LAMP server with PHP 5.0 at a later date,which is a radically different process to the one we are about to follow.2.1 Installation StepsInsert your Windows 2000 CD, and kill any start-up screenthat pops up.Click Start -> Settings -> Control Panel, and then doubleclick Add/Remove Programs.On the left panel, click Add/Remove Windows Components.On the pop-up window that appears, click on the tick boxbeside Internet Information Services (IIS).5. Click Next, Finish and then you may require a restart (hey,it is Windows!).Now to test out IIS, start up InternetExplorer and type in http://localhost/ as the site to visit: you shouldget the default "Welcome to IIS 5.0" web page.2.2 Enabling Support for Detecting UsernamesIn my experience building Intranet-based PHPapplications, I have found that many users prefer systems that can automaticallylog them in based on their network credentials. Here we are operating on theprincipal that if they were able to log onto a network workstation, then theymust possess a valid username and password. Rather than asking them to loginagain to our PHP applications, we can grab the client's network credentials,including the NT username, and login the user automatically, a technique oftentermed "pass-through authentication".Pass-through authentication is not possible for Internet-based applications; youwill still have to use manual logins and session management. For Internet IISserver set-ups, you can ignore the following steps.Click Start -> Settings -> Control Panel.Double-click Administrative Tools.Double-click Internet Services Manager.On the Tree tab on the left, click the plus sign besideyour computer's name, right-click the Default Web Site icon, then chooseProperties.Click the Directory Security tab, and then in theanonymous access section choose Edit.6. Now in the dialog that appears, un-check the checkbox
beside Anonymous access to disable anonymous access to your site. It is thensafe to click OK in any subsequent window, and then close the IIS manager windowwhen you are done.Now when any browser attempts to connect toyour default website, it must pass its network credentials to the IIS webserver, otherwise the connection will be refused. Later on in this tutorial, Iwill explain to you how you can access the environment variables containing theNT username in you PHP scripts.3. Installing MySQL 4.1+Now that we have a functioning web serverinstalled, we will install the next major component, our MySQL database server.The database server works on a similar principal to the HTTP server; that is itruns on Windows as a background service, while listening on a network port forSQL requests for data, then serving up the results of those queries to theclients that requested them.As I stated above, I believe it is safe to started using MySQL 4.1.x at thisstage, as I do not believe it will remain a beta (test) release for much longer.Installing MySQL is a simple process on Windows, follow the steps below.3.1 Installation StepsUnzip the zip file you downloaded containing the latestversion of MySQL 4.1.x to a local folder.Within the local folder, you will find SETUP.exe .Run this program to begin the installation.When asked, install the program to C:\mysql .(this should be the default option).Choose the Typical installation option.When the server is installed, we must start it.In C:\mysql\bin you will find a program called windmysqladmin.exe. Run this to start the server. If you like, you can add a shortcut to thisprogram to your start menu to get it to start automatically when you startWindows.Now test the server as described below.Start a DOS prompt, and type C:\mysql\bin\mysql. You should get the following screen:At the MySQL prompt, type show databases;and press return. By default, you will only have two databases to begin with.Now type exit and return to exit the MySQL client.3.2 Understanding the Windows Path Environment VariableRather than having to type C:\mysql\bin\mysql, it would be nicer to simply have to type mysql like any other DOScommand. We can do this by adding the C:\mysql\bin folder to the Pathvariable in Windows. Do the following:Right-click the My Computer icon on your desktop, thenchoose properties.Click the Advanced tab, and then click EnvironmentVariables.In the list of System Variables, choose Path, and thenclick Edit.At the end of the list of local folders, type ;C:\mysql\bin

Activity (5)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Anurag Goel liked this
farhad_karamy liked this
nramudu liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->