11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2• CONFIGURING YOUR ENVIRONMENTwww.it-ebooks.info4. A screen containing various items pertinent to the Apache server is displayednext. Take a moment to read through this information and then click Next.5. You will be prompted for various items pertinent to the server’s operation,including the <strong>net</strong>work domain, the server name, and the administrator’s e-mail address. If you know this information, fill it in now; otherwise, just enterlocalhost for the first two items and put in any e-mail address for the last. Youcan always change this information later in the httpd.conf file. You’ll also beprompted as to whether Apache should run as a service for all users or only forthe current user. If you want Apache to automatically start with the operatingsystem, which is recommended, then choose to install Apache as a service forall users. When you’re finished, click Next.6. You are prompted for a Setup Type: Typical or Custom. Unless there is aspecific reason you don’t want the Apache documentation installed, chooseTypical and click Next. Otherwise, choose Custom, click Next, and on the nextscreen, uncheck the Apache Documentation option.7. You’re prompted for the Destination folder. By default, this is C:\ProgramFiles\Apache Group. Consider changing this to C:\apache. Regardless of whatyou choose, keep in mind that the latter is used here for the sake ofconvention. Click Next.8. Click Install to complete the installation. That’s it for Apache. Next you’llinstall <strong>PHP</strong>.9. Unzip the <strong>PHP</strong> package, placing the contents into C:\php. You’re free tochoose any installation directory you please, but avoid choosing a path thatcontains spaces. Note that the installation directory C:\php will be usedthroughout this chapter for consistency.10. Navigate to C:\apache\conf and open httpd.conf for editing.11. Add the following three lines to the httpd.conf file. Consider adding themdirectly below the block of LoadModule entries located in the bottom of theGlobal Environment section:LoadModule php_module c:/php/php5apache2_2.dllAddType application/x-httpd-php .php<strong>PHP</strong>IniDir "c:\php"■ Tip The AddType directive in Step 11 binds a MIME type to a particular extension or extensions. The .phpextension is only a suggestion; you can use any extension you like, including .html, .php5, or even .jason. Inaddition, you can designate multiple extensions simply by including them all on the line, each separated by aspace. While some users prefer to use <strong>PHP</strong> in conjunction with the .html extension, keep in mind that doing sowill cause the file to be passed to <strong>PHP</strong> for parsing every single time an HTML file is requested. Some people mayconsider this convenient, but it will come at the cost of a performance decrease. Ultimately, it is stronglyrecommended you stick to common convention and use .php.14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!