Install Mysql Module Php Windows Installer

Posted on by

We’ve previously shown you how to get a working local installation of Apache on your Windows PC. In this article, we’ll show how to install PHP 5 as an Apache 2.2 module.

Why PHP?

PHP remains the most widespread and popular server-side programming language on the web. It is installed by most web hosts, has a simple learning curve, close ties with the MySQL database, and an excellent collection of libraries to cut your development time. PHP may not be perfect, but it should certainly be considered for your next web application. Both Yahoo and Facebook use it with great success.

If you choose to install MySQL Workbench, you will see a checkbox asking to open MySQL Workbench when the Installer closes. Make your choice and select Finish. You can start and stop your MySQL Server on Windows by connecting to it in MySQL Workbench. Install and Configure PHP. As guidance for installing PHP with Windows® Installer or using a compressed (Zip) file installation. MySQL for a database engine. Install and Configure MySQL for PHP Applications on IIS 7.; 5 minutes to read Contributors. In this article. By Ruslan Yakushev. While Microsoft® SQL Server® 2008 is the recommended database to use when hosting PHP applications on an Internet Information Services 7 (IIS 7) and above Web server, you can also use MySQL as the database. For instructions on installing MySQL using MySQL Installer, see Section 2.3.3, “MySQL Installer for Windows”. The standard binary distribution (packaged as a compressed file) contains all of the necessary files that you unpack into your chosen location.

Why Install PHP Locally?

Installing PHP on your development PC allows you to safely create and test a web application without affecting the data or systems on your live website. This article describes PHP installation as a module within the Windows version of Apache 2.2. Mac and Linux users will probably have it installed already.

All-in-One packages

There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. There is nothing wrong with using these packages, although manually installing Apache and PHP will help you learn more about the system and its configuration options.

The PHP Installer

Although an installer is available from php.net, I would recommend the manual installation if you already have a web server configured and running.

Manual Installation

Manual installation offers several benefits:

  • backing up, reinstalling, or moving the web server can be achieved in seconds (see 8 Tips for Surviving PC Failure) and
  • you have more control over PHP and Apache configuration.

Step 1: Download the files

Download the latest PHP 5 ZIP package from www.php.net/downloads.php

As always, virus scan the file and check its MD5 checksum using a tool such as fsum.

Step 2: Extract the files

We will install the PHP files to C:php, so create that folder and extract the contents of the ZIP file into it.

PHP can be installed anywhere on your system, but you will need to change the paths referenced in the following steps.

Step 3: Configure php.ini

Copy C:phpphp.ini-development to C:phpphp.ini. There are several lines you will need to change in a text editor (use search to find the current setting). Where applicable, you will need to remove the leading semicolon to uncomment these setting.

Define the extension directory:

Enable extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for the majority of applications:

If you want to send emails using the PHP mail() function, enter the details of an SMTP server (your ISP’s server should be suitable):

Step 4: Add C:php to the path environment variable

To ensure Windows can find PHP, you need to change the path environment variable. Open Settings, type ‘environment variables’ into the search field and open the result. Select the “Advanced” tab, and click the “Environment Variables” button.

Scroll down the System variables list and click on “Path” followed by the “Edit” button. Click “Edit text” and add ;C:php to the end of the Variable value line (remember the semicolon).

Now click OK until you’re out. You might need to reboot at this stage.

Step 5: Configure PHP as an Apache module

Ensure Apache is not running (use net stop Apache2.2 from the command line) and open its confhttpd.conf configuration file in an editor. The following lines should be changed:

On line 239, add index.php as a default file name:

At the bottom of the file, add the following lines (change the PHP file locations if necessary):

Php Windows Download

Save the configuration file and test it from the command line (Start > Run > cmd):

Step 6: Test a PHP file

Mysql On Windows

Create a file named index.php in Apache’s web page root (either htdocs or D:WebPages) and add this code:

HP and others have had poor quality issues with heat involved. No battery is detected vaio. HP and others have had bad battery history, check at their support website for any recalls. If the operation of your laptop was extremely hot, it may have surrcomed to heat damage. Next, a battery should be dependable for roughly 18mos., anything after that is a gift. Either the charging ckt.

Ensure Apache has started successfully, open a web browser and enter the address http://localhost/. If all goes well, a “PHP version” page should appear showing all the configuration settings.

See also:

  • Book: PHP & MySQL: Novice to Ninja, 6th Edition.
  • Book: Jump Start PHP Environment, as well as many more books in our library.

Best of luck!

Mysql Installation On Windows 10

PHP 5.2.9.2 Install on XP Pro IIS 5.1 - phpinfo( ) results incorrect
Testing Date: 05.15.09
Background:
For several days now I, as a newbie, have been unsure if I had installed PHP correctly, or not. No matter what I did phpinfo( ) reported 'Configuratin File Path' as: “C:WINDOWS”. I was left to wonder what was wrong.
To help resolve the phpinfo() “issue”, I conducted a series of tests using two scripts:
The first is “test-php-ini-loaded.php”; it is stored in c:inetpubwwwroot, and has the following code:
<?php
$inipath
= php_ini_loaded_file();
if (
$inipath) {
echo
'Loaded php.ini: ' . $inipath;
} else {
echo
'A php.ini file is not loaded';
}
?>

The second script is simply calls phpinfo( ). It is named test.php, is stored in “c:inetpubwwroot”, and has the following code:
<?php phpinfo( ); ?>

My Dev Environment:
1. Windows XP Pro SP3
2. IIS 5.1 / MMC 3.0
3. PHP 5.2.9.2 – phpMyAdmin not yet installed
4. (plus MySQL 5.1, etc.)
5. Install location is on my local E: drive
The Tests:
Test 1:
a. PHPRC environment variable and IniFilePath Registry left in place and active
b. Verified no other copies of php.ini exist on the system other than in my E:PHP folder
c. Renamed php.ini to hold-php.ini
d. Stopped and started IIS (“net stop iisadmin” and “net start w3svc”)
e. Ran “test-php-ini-loaded.php” to check whether my php.ini is loaded. It is not.
f. Ran 'test.php'. “Loaded Configuration File” was empty, while “Configuration File (php.ini) Path” showed: C:WINDOWS.
Test 2:
a. Moved php.ini from E:PHP to C:WINDOWS
b. Stopped and started IIS
c. Ran 'test-php-ini-loaded.php' to check if my php.ini is loaded. It is not, which surprised me.
d. Ran 'test.php'. My php.ini is apparently not loaded, or found, by phpinfo( ), even though “Configuration File (php.ini) Path” reports it as being in C:WINDOWS.
e. Note: Per PHP’s “The configuration file” note, PHP's search order includes: “Windows directory (C:windows or C:winnt) (for Windows), ..”; but it apparently doesn’t or php.ini would have been found and displayed at “Loaded Configuration File”.
Test 3:
a. Left the solo copy of my php.ini in C:WINDOWS
b. Disabled PHPRC environment variable by renaming it to “Ex-PHPRC and saving the settings (note: for this test I left the Registry entry for PHP IniFilePath intact)
c. Stopped and started IIS
d. Ran 'test-php-ini-loaded.php' to check whether my php.ini is loaded. Predictably it is not found.
e. Ran the 'test.php'. Again, my php.ini file is reported as not found in C:WINDOWS though “Configuration File (php.ini) Path” reports it as being there.
Test 4:
a. To be thorough and eliminate all possible sources of “mis-direction” I deleted the PHP IniFilePath Registry entry (after backing up the Registry). The PHPRC environment variable was left disabled.
b. Stopped and started IIS
c. Ran 'test-php-ini-loaded.php' to check whether my php.ini is loaded. Predictably it is not.
d. Ran 'test.php'. Again, no change. My php.ini file is not found “Configuration File (php.ini) Path” reports it as being there.
Conclusions:
The first conclusion I came to is that, in the default download version of phpinfo( ), “Configuration File (php.ini) Path” is hard-wired to report C:WINDOWS whether php.ini is there or not. Further, that C:WINDOWS is not a default search location (at least not on XP).
However, given an otherwise “proper” setup, phpinfo() reporting C:WINDOWS as the value for “Configuration File (php.ini) Path” is merely misleading and is not actually harmful or indicative of a failed installation.
Thanks go to Peter Guy of www.peterguy.com who suggested the testing, and to Daniel Brown of www.php.net for some initial guidance.
P.S. This note is not meant to take anything away from PHP. It is a fine tool. The sole purpose of the testing was to confirm that my installation of PHP was correct.