TUTORIAL: How to install PHP and MySQL on IIS

  • Crumpybumpy
  • Born
  • Born
  • Crumpybumpy
  • Posts: 1

Post 3+ Months Ago

I went through all of your steps..my set up is:

My setup:

WinXP Pro
IIS 5.1
PHP Version 5.2.5
MySQL Server 5.0
PHPMyAdmin 2.11.3

PHP works, and I can log onto MYSQL. When I try to run phpmyadmin i get:

"phpMyAdmin - Error
Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly."

Where are these logs under IIS?

Any pointers on how to troubleshoot this? I had all of this running well about 2 years ago but that must have been with older versions of everything......
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

turn on php error reporting to see what the exact error is. Here's a couple ways to do it

http://www.blizzard-media.com/hosting/q ... /id/6.html
http://www.wallpaperama.com/forums/how- ... -t453.html

The easiest way is to just edit your php.ini file
display_errors = On
  • rayeniguard
  • Newbie
  • Newbie
  • rayeniguard
  • Posts: 7

Post 3+ Months Ago

Hey CrumpyBumpy,

I experienced the same error with PHP. The error message is vague. So, a solution for one may not be a solution for the other. Nevertheless, I'll tell you what I did.

In the php.ini file, I enabled the extension=php_mbstring.dll under the dynamic extensions section.

The IIS log files are located at:

C:\WINDOWS\system32\Logfiles\W3SVC1
  • rayeniguard
  • Newbie
  • Newbie
  • rayeniguard
  • Posts: 7

Post 3+ Months Ago

I spoke too soon.

Yes, the last test script I posted tells me that the user connected successfully. However, when I view MySQL Administrator, I see no connect.

Troubleshooting continues...
  • rayeniguard
  • Newbie
  • Newbie
  • rayeniguard
  • Posts: 7

Post 3+ Months Ago

Finally, I found my error.

<?php is needed as opposed to <? when opening a php script.
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

Thank you ATNO/TW for the great tutorial. MySQL Administrator is a great tool (first time I've seen it).

Thank you too for taking the time to help all us noobs with this setup.

Now for my issue. I'm trying to setup PHPBB for our gaming group and just can't get it to work. It seems that PHP is installed correctly (I get the info.php screen ok see: http://forum.questersguild.com/info.php). It seems that MySQL is installed correctly (I get the part where I enter password in MySQL monitor and log in successfully). However, when I go to the setup for PHPBB it doesn't show MySQL as being installed (http://forum.questersguild.com/install/ ... anguage=en). In MySQL Administrator it shows 3 databases: information_schema, mysql and test.

I've totally removed everything (PHP, MySQL, PHPBB) and reinstalled without luck. I did get stuck on one thing during your tutorial, the part about editing the php.ini file. I don't have one in my C:\Windows directory so I edited the one in my C:\PHP directory. C:\PHP is in my path so that should work.

I'm a newbie with PHP, PHPBB and MySQL so I may have missed an easy thing but I'm just at a loss right now. Thank you for any help you can give me.

P.S. I did try the PHPBB forums and was unable to get any help.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Use MySQL administrator to create a new database. By default phpbb2 used forumdata as a database name (however you can name it anything you want). Then create a user in MySQL Admin and grant that user rights to the new database. phpbb does not create the database for you. You have to do that first. Then in the install enter the username and password of the user you assigned rights to the database. Then the phpbb install will create the tables and populate the database for you.


Then try the phpbb install. Make sure your config.php file is writeable by all.

btw, thanks for the compliments. Much appreciated.
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

You especially deserve the compliments. I realize how much time it takes to do your life, work and still moderate a forum like this.

Sorry it took me so long to try this out. That whole life thing keeps getting in the way. :wink: This is what I have so far.

I had an existing database from a previous install on an Apache server called php so I moved the folder to the "C:\MySQL\MySQL Server 5.0\data" folder. Restarted MySQL service and I can see it fine in MySQL Administrator. I then created a user called phpbb and assigned all privelages to that user. (see my screen shots)

I then checked the permissions on the config.php in the forum directory and they are set so everyone can write, read and execute and modify.

Launching the install for phpbb still shows MYSQL as unavailable.

I would be happy to try a totally new database but I don't know where to create one in MySQL Administrator.

Thanks again for your help and if you need information I'm not including please ask me because I'm not sure what else you may need.

Screen shots:
ImageImage
  • n_oandasan
  • Newbie
  • Newbie
  • n_oandasan
  • Posts: 10
  • Loc: Philippines

Post 3+ Months Ago

go to http://www.myphp.com
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

That is an advertising web search page. Why go there n_oandasan?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Open config.php in an editor. By default it is blank. If anything is in it, remove it and replace it with this:

PHP Code: [ Select ]
<?php
 
 
 
 
 
// phpBB 2.x auto-generated config file
 
// Do not change anything in this file!
 
 
 
$dbms = 'mysql';
 
 
 
$dbhost = 'localhost';
 
$dbname = 'php';
 
$dbuser = 'phpbb';
 
$dbpasswd = '******';  //password for phpbb user.
 
 
 
$table_prefix = 'phpbb_';
 
 
 
define('PHPBB_INSTALLED', true);
 
 
 
?>
  1. <?php
  2.  
  3.  
  4.  
  5.  
  6.  
  7. // phpBB 2.x auto-generated config file
  8.  
  9. // Do not change anything in this file!
  10.  
  11.  
  12.  
  13. $dbms = 'mysql';
  14.  
  15.  
  16.  
  17. $dbhost = 'localhost';
  18.  
  19. $dbname = 'php';
  20.  
  21. $dbuser = 'phpbb';
  22.  
  23. $dbpasswd = '******';  //password for phpbb user.
  24.  
  25.  
  26.  
  27. $table_prefix = 'phpbb_';
  28.  
  29.  
  30.  
  31. define('PHPBB_INSTALLED', true);
  32.  
  33.  
  34.  
  35. ?>


Save it, then remove the install and contrib folders and try to access it in a browser:

http://localhost/phpbb/index.php (or the correct path to your forum)

If you get errors, post the exact error message.
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

I made the change to the config.php file, removed the install directory and I did not have a contrib folder.

The error I get when I try http://forum.questersguild.com/index.php is:

Code: [ Select ]
The website cannot display the page    HTTP 500 
Most likely causes:
The website is under maintenance.
The website has a programming error.

What you can try:
Refresh the page.

Go back to the previous page.

More information
  1. The website cannot display the page    HTTP 500 
  2. Most likely causes:
  3. The website is under maintenance.
  4. The website has a programming error.
  5. What you can try:
  6. Refresh the page.
  7. Go back to the previous page.
  8. More information


This PHP file (I copied from a website and put in the same directory with the index.php) pulls the date and seems to work fine: http://forum.questersguild.com/date.php

I put this because it seems PHP is working. The code I used for the date is

Code: [ Select ]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Today's Date</title>
<meta http-equiv="content-type"
  content="text/html; charset=iso-8859-1" />
</head>
<body>
<p>Today's Date at Quester's Guild is <?php

echo date('l, F dS Y.');

?></p>
<p> </p>
<p> </p>
<p> </p>
<p> <h1>Check for our new forums coming soon.</h1> </p>

</body>
</html>
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>Today's Date</title>
  6. <meta http-equiv="content-type"
  7.   content="text/html; charset=iso-8859-1" />
  8. </head>
  9. <body>
  10. <p>Today's Date at Quester's Guild is <?php
  11. echo date('l, F dS Y.');
  12. ?></p>
  13. <p> </p>
  14. <p> </p>
  15. <p> </p>
  16. <p> <h1>Check for our new forums coming soon.</h1> </p>
  17. </body>
  18. </html>
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

Sorry about the double post but I just removed everything in the forum directory and put all the files from the PHPBB3.0 zip download file (except the nice config.php file you just had me make) and I got the same results.

One other thing: in the config.php file where "$dbpasswd = '******'; //password for phpbb user. " is should I substitute the password for ******? Sorry if that is a dumb question but I hate assuming then being wrong. (I tried it both ways and neither worked.)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

yes, that was the idea.

Did you try the info.php file as suggested in the tutorial? If so, does it recognize and give information about MySQL? If it does, then the problem is a connection issue.
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

Yes, I did and it works great. I don't see anything about MySQL in the info.php. If the info can help you take a look at http://forum.questersguild.com/info.php

By connection issue what do you mean and would a MySQL reinstall help or what's my next step?

I was thinking through some stuff and maybe this has something to do with what is going on here (or I could just be throwing in a some unnecessary information :? ). I use host headers because I host several websites and as a result the http://localhost addresses will not work for the PHPBB stuff. Do I need to change something during the MySQL setup to point to the actual address for the forums rather than localhost?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Rich_Bailey77 wrote:
I was thinking through some stuff and maybe this has something to do with what is going on here (or I could just be throwing in a some unnecessary information :? ). I use host headers because I host several websites and as a result the http://localhost addresses will not work for the PHPBB stuff. Do I need to change something during the MySQL setup to point to the actual address for the forums rather than localhost?


I'd be very certain that would be your trouble spot. Unfortunately I've never set up a system like you appear to have it, so don't know what to suggest. But I would certainly focus the troubleshooting on that.
  • Rich_Bailey77
  • Newbie
  • Newbie
  • User avatar
  • Posts: 8

Post 3+ Months Ago

I'm not making much progress with MySQL. Would you have any advice for using MSSQL Server 2000+ via ODBC since that says available?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

You can use php with MSSQL Server, but I've never done it, so really have no advice. You might want to start a new separate thread if you'd like to try that approach.
  • Leshincorp
  • Born
  • Born
  • Leshincorp
  • Posts: 1

Post 3+ Months Ago

Hello.

I followed the tute. But I am unable to pull up the info.php.

I have done everything in the posts. Tried reinstalling php and mysql and still it is not pulling a page, not from localhost, nor from xxx.xxx.xxx.xxx/info.php


Any ideas why this could be?


Also. I have uninstalled php and mysql 20 times. Have uninstalled the IIS service 3 times. Still I can not view the php page. I can't even view the localhost default page. I have went into properties and assigned it, its Static IP address, still I can not view it LAN or Public. I was able to get prompt for the un/pw, nothing worked for that either. Now it gives me a error 400 Bad Request.
I am sure I have muckeled something up, but I am unsure as to what. Lol

The php version I am installing is 5.25
The mySQl version I am installing is 5.0.51
I am installing it on Server 2003.


Thanks
Lesh
  • yomi
  • Graduate
  • Graduate
  • User avatar
  • Posts: 116
  • Loc: Nigeria

Post 3+ Months Ago

hi

have a new challenge today! mysql db is connecting fine but i have this error.

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line

i had to enter the cmd env to test my query cos my php pages were just working like links. i know my php is ok cos i call pages with functions. i can select from my db tables but cant update or insert.

what can i do?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

Yomi, please repost this in your other post and just use that one so we can keep everything in the same place.

programming-forum/mysql-connect-error-t86937.html

Just use that one to add updates to your problem.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'm locking this thread as read only, primarily because the tutorial is a bit outdated. I'll be revising it soon and adding the updated version to the Tutorial section.

If you've followed the tutorial and still have problems that you need to ask about, please create a new Post in this Programming section and we'll help you there.

Post Information

  • Total Posts in this topic: 142 posts
  • Users browsing this forum: No registered users and 63 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.