Jump to content

Wish to Install PHP/MySQL on Windows 7 PC, Which one do I install ?


Recommended Posts

I have Windows 7 and wish to install PHP and MySQL on it to save on uploading and testing my code each and everytime I make a change!!

 

But I get a page of install files on http://windows.php.net/download/

 

So wish to find out what one I should use for very basic usage, just PHP and MySQL are needed no https or IIS.

 

My server is Linux and has PHP 5.2.8 and MySQL 5.0.67-community

Link to comment
Share on other sites

You're going to need to install a http server on to your computer in order to run your PHP scrupts. I'd suggest you to install Apache2.2 from http://httpd.apache.org

Download the latests version of MySQL5.0 Community Server from http://downloads.mysql.com

 

For PHP you'll want to download the PHP 5.2 package titled VC6 x86 Non Thread Safe and choose the zip option. Do not use the Installer

 

Once you have Apache, PHP and MySQL downloaded. First install Apache. However during the Installation process click the Customise install option, choose to install Apache to C:\Server\Apache

In one of the steps it'll ask for some hostnames, just type in localhost for both cases. The web server administrator email address can be any address, fake or valid. I normally just use webmaster@localhost.

 

Next, extract the PHP zip package to C:\Server\PHP. Now open the folder C:\Server\PHP and rename the file named php.ini-recommended to php.ini. Next you'll want to add the PHP folder to the PATH Environment Variable. Restart your computer to finish the PHP installation

 

Once you're computer has restarted. Open Apaches httpd.conf configuration file (Located in C:/Server/Apache/httpd). Add these three lines to the bottom of the file

# PHP5 configuration
LoadModule "C:/Server/PHP/php5apache2_2.dll"
PHPIniDir "C:/Server/PHP"
AddType application-x/httpd-php5 .php

Save the httpd.conf and restart Apache (there should be an Apache taskbar icon. left click this icon and choose Restart).

 

Before configuring Apache/PHP. First create a file called info.php in Apaches htdocs folder (C:/Server/Apache/htdocs) and place this code into the file

<?php phpinfo(); ?>

Delete the existing files in the htdocs folder too.

Now open your web browser and go to http://localhost/info.php. You should get a page generated displaying the PHP version and configuration.

Confirm the line that reads Loaded Configuration File does point to C:/Server/PHP/php.ini. If this is correct then Apache and PHP are properly configured.

 

You can now setup Apache/PHP as you require. Just remember to restart Apache if make any changes to Apache and/or PHP's configuration.

 

Lastly install MySQL to C:/Server/MySQL. The default installation options should be fine.

Link to comment
Share on other sites

  • 2 months later...

Worked for me

BUT

I changed

 

# PHP5 configuration

LoadModule "C:/Server/PHP/php5apache2_2.dll"

PHPIniDir "C:/Server/PHP"

AddType application-x/httpd-php5 .php

 

to

 

# PHP5 configuration

LoadModule php5module "C:/Server/PHP/php5apache2_2.dll"

PHPIniDir "C:/Server/PHP"

AddType application/x-httpd-php .php

 

Thanks, many days of pain are over

Link to comment
Share on other sites

You're going to need to install a http server on to your computer in order to run your PHP scrupts

 

You can run PHP command line too. While it might seem pointless, there is a lot of cool stuff you can use it for. I wrote a backup system / server checker that runs as a command line app, and it emails me if any of the servers go down. You can also do image resizing and just general PHP practicing in command line.

 

You'll probably WANT apache, but you should know how to run PHP without it. Last time I interviewed someone, one of the interview questions was a command line script that would read a url and print the value at it every 10 ten seconds -- you'd be amazed how few people got it =/ It was even an open-internet test!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.