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.

www.it-ebooks.infoCHAPTER 2 • CONFIGURING YOUR ENVIRONMENTvarious nonstandard settings and is intended to better secure and optimizeyour installation, although this configuration may not be fully compatible withsome of the legacy applications. Consider using this file in lieu of php.inidist.To use this file, execute the following command:%>cp php.ini-recommended /usr/local/lib/php.ini6. Open Apache’s configuration file, known as httpd.conf, and verify that thefollowing lines exist. (The httpd.conf file is located atAPACHE_INSTALL_DIR/conf/httpd.conf.) If they don’t exist, go ahead and addthem. Consider adding each alongside the other LoadModule and AddTypeentries, respectively:LoadModule php5_module modules/libphp5.soAddType application/x-httpd-php .phpBelieve it or not, that’s it. Restart the Apache server with the following command:%>/usr/local/apache/bin/apachectl restartProceed to the “Testing Your Installation” section.■ Tip The AddType directive in Step 6 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 ultimately cause the file to be passed to <strong>PHP</strong> for parsing every single time an HTML file is requested. Somepeople may consider this convenient, but it will come at the cost of performance.Installing Apache and <strong>PHP</strong> on WindowsWhereas previous Windows-based versions of Apache weren’t optimized for the Windows platform,Apache 2 was completely rewritten to take advantage of Windows platform-specific features. Even if youdon’t plan to deploy your application on Windows, it no<strong>net</strong>heless makes a great localized testingenvironment for those users who prefer Windows over other platforms. The installation process follows:1. Start the Apache installer by double-clicking the apache_X.X.XX-win32-x86-no_ssl.msi icon. The Xs in this file name represent the latest stable versionnumbers of the distributions you downloaded in the previous section.2. The installation process begins with a welcome screen. Take a moment to readthe screen and then click Next.3. The license agreement is displayed next. Carefully read through the license.Assuming that you agree with the license stipulations, click Next.133

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

Saved successfully!

Ooh no, something went wrong!