Installing and Configuring Apache 2 on a Windows XP Machine - Configuring MySql (
Page 5 of 5 )
All that remains is to install and configure MySql. This is probably the trickiest part and involves several steps for success. First, download the MySql 4.1 installer for Windows from www.mysql.com and run it. Accept all the defaults and use localhost for the server name. A guest account will work, but will not be as secure as one with a password.
Once MySql is installed, go to the System control panel applet, select the Advanced tab and click the Environment Variables button. Highlight the Path variable and select the Edit button. Go the very end of the line and add ;C:\php then click OK.

You’ll need to restart the machine at this point. Now go to the find files option in the start menu and do a search for libmysql.dll, then copy this file to your default PHP location (C:\php). Now go back to the find files window, do a search for php.ini and open the file found in Notepad. Scroll down until you find ;extension=php_mysql.dll and remove the semi-colon from the beginning of the line. Save this file and restart Apache. This should work fine, but if you get an error message saying that the libmysql.dll file could not be found, try copying this file to the Apache Bin folder as well.
To test MySql, open Notepad and type the following:
<?php
$dbServer='localhost';
$dbUser='root';
$dbPass=' ';
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die
("Could not connect");
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";
mysql_close($link);
?>
This will simply attempt to connect to the server and select the test database that is created during the MySql installation. Save this file as mysql.php in your web site folder then open a browser and type http://localhost/mysql.php. You should see a web page displaying:
Connected successfully
Database selected successfully
Your WAMP installation is now complete. You should now be all set to begin creating and testing complex database driven, dynamic web sites. Please note that the set up described in this article is for closed, development environments only. This configuration is in no way secure and should not be used for production.
| | Discuss Installing and Configuring Apache 2 on a Windows XP Machine | | | | | | | Personally I just use Xampp. It's a lot easier to get up and running with a full... | | | | | | The XAMPP or XAMPPLite packes look very good and hassle free, but if you are looking... | | | | | | Thanks for the article in the step-by-step, easy to read and understand fashion.... | | | | | | Hi all,
When I uncomment ;extension=php_msql.dll this line and put the... | | | | | | You had uncommented the ;extension=php_msql.dll
not... | | | | | | Hi Dan,
I received the following error message:
PHP Startup: Unable to load... | | | | | | Hi,
I far as I know, there should not be a C:\php\ext folder, the libmysql.dll... | | | | | | I'm glad the article has helped, happy coding!
Dan | | | | | | Hi,
Did the above help, or do you still have issues with mySql? | | | | | | I got the same error:
PHP Startup: Unable to load dynamic library... | | | | | | I followed the instruction, but all I get was
"<html>
</html>"
It's not... | | | | | | I followed the tutorial exactly, and it worked great under firefox. I then tried it... | | | | | | Hi all, I have the same error. I tried extracting the php_mysql.dll file but it... | | | | | | ok people, I'm surprised that so many people are haviving similar issues when... | | | | | | I have completely uninstalled Apache2, PHP5 and Mysql. Then deleted all the folders... | | | | | | Hi, sorry you're still having problems...I replicated your error exactly by... | | | | | | Also, do a quick search for php_mysql.dll
This should be in your... | | | | | | hey, ive got a slight problem with mysql.
first off in the mysql instructions,... | | | | | | Hi Dan thanks for replying. The php_mysql.php wasn't in the system32 folder. It is... | | | | | | *update*
found i was editing C:\PHP\BACKUP\php.ini instead of... | | | | | |
Put the php_mysql.dll file in to your windows/system32 folder. That stopped that... | | | | | | sorry, im very tired from battling with my stupid internet connection all day,... | | | | | | Thanks for the updates Trev, your version of the code will work fine, although it is... | | | | | | sorry Trev replied to the comments in the wrong order..! | | | | | | Don't worry about your post being so long - all good advice! Appreciate the... | | | | | | Hi everybody, the solution now appears to be contained fully within this blog, I'm... | | | | | | thanks Dan
my comments about the code were actually aimed at Trevor and not you,... | | | | | | Yeah, just copy the "php_mysql.dll" file from the [b]PHP zip package[/b] (not EXE... | | | | | | Hi,
Ha ha, not to worry in that case :sheepish:
With regard to altering the... | | | | | | This might sound stupid, but what is the solution to fixing these error message.... | | | | | | Thank you for your advise. I have my trusty PHP book (Beginners) and of course the... | | | | | | Hi,
Provided the mysql.php code is *exactly* as shown in the eample it should... | | | | | | I checked and sql.safe_mode is Off and i copied exact code for the guide, but still... | | | | | | when you installed mysql, did you set a password? The default installation should... | | | | | | i've followed this tutorial and everything works apart from the mysql..
i've... | | | | | | Hi,
It seems that you have SQL safe mode set to ON in PHP.INI. Scroll throught... | | | | | | yeh that solved the sql safe mode error but its still showing the other error... any... | | | | | | Hmmmmm, the error doesn't give much info does it, although from your code, it looks... | | | | | | sorry about the smilies, they are all ')' characters | | | | | | Concerning port 80 - Skype usually uses it, so be careful. My Apache2 installation... | | | | | | Thanks for sharing this, I had the same problem regarding Skype and meant to put... | | | | | | Please forgive my "newbieness", but I have run into a problem. Obviously I am... | | | | | | You haven't got IIS running have you? | | | | | | I am having the same problem as the user above ("The page cannot be displayed"). I... | | | | | | Was skype installed and running when you did this? If so, switch it off whilst you... | | | | | | No, I do not have Skype installed now nor when I was installing Apache2. | | | | | | Well, I have to admit, I don't know why you arn't seeing the Apache start page. ... | | | | | | Enjoyed working on this problem but I recieve the same error.
"Fatal error: Call... | | | | | | It is possible (but unlikely) that it's an issue with XP home rather than XP... | | | | | | I finish the 3 step but i can't see my htm file.
The browser (Firefox) says "Não... | | | | | | Have you tried saving the file with the full .html extension? | | | | | | yes, but it keep showing the same message.
Can you tell me what restart the server... | | | | | | Rebooting the server means basically stopping the web server process then starting... | | | | | | I reinstall Apache and i was able to see welcome to Apache page.
Then i change the... | | | | | | Hi,
Could you paste your entire httpd.conf file into an email and send it to me?... | | | | | | Hi Dan,
I too am stuck on seeing the directory style listing "index of/" i.e "my... | | | | | | Hi Dan,
This time I have logged in as username: scottalap
I have gotten stuck... | | | | | | Hi guys,
The DirectoryIndex directive should already be present in your... | | | | | | Hi, thanks for a website like this am very happy to have followed your work and am ... | | | | | | Hi,
I'm glad you were able to follow the article and install everything ok,... | | | | | | Hello Dan. I can't seem to get Apache 2.0, and Php 5.1.4 configured in Windows XP... | | | | | | Hi Dan, great work!
I Installed Apache 2.2.2 and it worked well. however php 5.1.4... | | | | | | Hi,
I'm really sorry I didn't post back sooner but I've been on holiday and moved... | | | | | | Here you go, a copy of my working http.conf file:
#
# Based upon the NCSA server... | | | | | | Thanks heaps... That httpd.conf file has much more stuff than mine, to avoid... | | | | | | Thank you soooo much, got php5 right finaly mostly due to your httpd.conf document,... | | | | | | Dude, I am glad its working for you now, happy coding! | | | | | | Hi,
So far everything went smoothly with Apache (I had to close Skype though). I... | | | | | | I fixed the 403 problem by downgrading Apache to the 2.0.x version. It is working... | | | | | | Hi Asaf, i got this from the tutorial earlier, i too overlooked it accidentally and... | | | | | | Hi Stephen,
Thanks for the answer. I actually have added the index.php to the file,... | | | | | | First of all, thank Dan for the How-To.
2nd, thank to the person above.
I have... | | | | | | Hi,
index.htm is a throwback from when file extensions had to be three... | | | | | | Great tutorial, Dan. All seems to work well until page 4, the website came up fine... | | | | | | Hi, it may be a difference in the setup but if everything looked like it did in the... | | | | | | Solved the PHP issue by reverting to an earlier revision as suggested above. SQL... | | | | | | The message states that a password is being used in the referenced file, did you... | | | | | | Thanks Dan. I had copied and pasted the file - and yes, there was an imbedded... | | | | | | Hi Larry, glad that got it going for you.
The Apache site says that it does not... | | | | | | I have been working on getting my Apache server working and could never get .php... | | | | | | Hi Dan.....Please help !!
Wonderful article...makes things look awfully simple.... | | | | | | hi Dan i am working with apache ver 2 ? how do i set it up so users can log in to my... | | | | | | hi Dan i got Apache working just fine. how Do i set it up so users from the out side... | | | | | | Hi,
You can set Apache up to listen to requests from your IP, however, you need a... | | | | | | i have got static ip adds i have 5 and i plan seting apache on windows server... | | | | | | Hi Dan
I have tried mutiple versions of apache on Windows. IIS works if i install... | | | | | | Hmmmm, tough call. Got any chat software running like skype or aim?
Dan | | | | | | This was a great article. I downloaded Apache onto my WindowsXP computer. The... | | | | | | what does it say? 'Page not displayed' or anything else?
Dan Wellman | | | | | | This is the message from IE7:
Internet Explorer cannot display the webpage
... | | | | | | hmmm, just tried IE7 on my config (pretty similar to that advised in the article)... | | | | | | Thanks....and how would I do that? | | | | | | Ok, look in the folder where that you have set to be the document root for Apache,... | | | | | | I too am using Apache2.2 and PHP5 and have had no success with the index.php as... | | | | | | I don't see my previous reply yet, but will assume that when reviewed they will come... | | | | | | In reading through a lot of these comments, I am beginning to wonder if... | | | | | | Okay, I think I'm getting the hang of this thing. Maybe they should change the... | | | | | | Okay, I think I'm getting the hang of this thing. Maybe they should change the... | | | | | | Help! I'm going gray rapidly!!!
I've installed Apache 2 on Windows XP... | | | | | | HI,
I gone through your forum for the problem while running Apache on your local... | | | | | | i had the same problem (copy/pasted straight from the tutorial), but then i noticed... | | | | | | Hi I got an error message after installing the apache server on my window xp media... | | | | | | sounds like you have som other app using port 80, usually its an IM prog.... | | | | | | Could you or anyone else please elaborate as to why using apache on Windows is less... | | | | | | windows is buggier and has more security holes in it. I can't tell you which bugs... | | | | | | >>> Post your comment now! | | | | | |
|
 |
|
|
|
|
| |
|
|
|
|
 |
|
|
|