TUTORIAL: How to install PHP and MySQL on IIS

  • RickSavoy
  • Born
  • Born
  • No Avatar
  • Joined: Jun 05, 2007
  • Posts: 3
  • Status: Offline

Post June 6th, 2007, 7:38 am

I used your tutorial (Thanks for your work on that btw.) but I am having a problem connecting to any database. All of the following are on my local machine: PHP 5.2.2, IIS Server 5.1,MySql 5.0.41-cimmunity-nt and MS Server 2005 Developer. When I couldn’t connect to Server 2005, I loaded MySql. I get similar errors while attempting to connect to either server. Mostly, no errors reported and no connection, the script just stops dead (I have tried a variety of connection strings but this is the latest).

$link_id = mysql_connect();
if($link_id) echo "Connected to the MySQL server successfully<br>";
else die ("Connection to the MySQL server was unsuccessful");

As mentioned, I am getting the similar results while trying to connect to MS Server 2005 using $link_id = mssql_connect(); .

Btw, I am having no trouble connecting to Server 2005 using ASP. But we have projects coming up that will require PHP.

PHP scripts that do not require a connection to the database are working fine. I have no trouble logging into MySql at the command prompt. It could be a separate issue, but when I try to log into Server 2005 thru an ODBC connection, I get a 18456, state 11 error.

I appreciate whatever help you folks can give on this. Thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 6th, 2007, 7:38 am

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23407
  • Loc: Woodbridge VA
  • Status: Offline

Post June 6th, 2007, 8:44 am

Check the comments in the post about using "old_password". Seems like most php programs I've tried on Windows do not like the default password encryption. Not sure why, but switching to old_password and creating new user accounts with old password encryption seemed to work. You can change existing users to old_password from a command line but I've run into glitches with that especially when trying to change root.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • RickSavoy
  • Born
  • Born
  • No Avatar
  • Joined: Jun 05, 2007
  • Posts: 3
  • Status: Offline

Post June 6th, 2007, 9:20 am

I followed the steps in http://dev.mysql.com/doc/refman/5.0/en/old-client.html and I am still getting the same results.
Btw I changed the script to:
$link_id = mysql_connect("localhost", $dbuser, $dbpass);
mysql_select_db($dbname);

if($link_id)
echo"Connected! <br>";
else
die("Connection failed");

Still getting the error “Connection failed”.
  • RickSavoy
  • Born
  • Born
  • No Avatar
  • Joined: Jun 05, 2007
  • Posts: 3
  • Status: Offline

Post June 6th, 2007, 9:30 am

I got it! I misspelled my password. Strange as it may sound, that seems to affect the attempted connection rather adversly I see.
  • esm
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 08, 2007
  • Posts: 6
  • Status: Offline

Post June 8th, 2007, 1:45 pm

Hi,

I'm new to this forum and I'm seeking help in getting mysql install working. The install went without any problems (XP2) but when I try to start the service I get these results:

Using the Command Line:
As soon as I hit "Enter" after typing the password, the black window disappears immediately.

Using the Config wizard: Error message that the service could not be started.

I checked the services page in "Admin. Tools" but mysql is not listed there. I did a complete uninstall and a re-install but no change, the service just doesn't start. What can I do?

PS. I also have the Apache (2.2.4) server installed and it seems to work fine.
  • bearhd
  • Born
  • Born
  • No Avatar
  • Joined: Jun 27, 2007
  • Posts: 1
  • Status: Offline

Post June 27th, 2007, 12:21 pm

Some body please HELP!
I have followed the instructions on this forum for installing PHP and MySQL on windows XP IIS and all has gone well (amazing tutorial by ATNO).
But when installing phpMyAdmin the wheels come off.

I have been through everything posted on this forum and cant get it to run smoothly.
I have actually gotten to the http://localhost/phpMyAdmin/index.php page on a couple of occassions and its worked but then I close the browser and try to access it again and I get this:
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

it will work/not work spiratically without me changing any setting at all. I am freaking out over here because I am trying to get all this set up so I can develop a database for website I am working on which is due in less than a week. Admittedly my PHP/MySQL skills are rudamentary at best but I am usually pretty good at following directions and guidlines which gets me through. However in this situation I am completely stumped and would greatly appreciate any for of advice or help that anyone can offer me.

thank you


--edit--

On one of the times I was successfully able to log in to phpMyAdmin, I attempted to make a test database with a test table. The database is created, but when I attempt to create tables I get this error:

No tables found in database.
PHP Warning: session_write_close() [function.session-write-close]: open(C:\DOCUME~1\YEMI\LOCALS~1\Temp\php\session\sess_apbmimv71ugga9lji84saqshi3, O_RDWR) failed: Permission denied (13) in C:\Inetpub\wwwroot\phpMyAdmin\navigation.php on line 82 PHP Warning: session_write_close() [function.session-write-close]: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\DOCUME~1\YEMI\LOCALS~1\Temp\php\session) in C:\Inetpub\wwwroot\phpMyAdmin\navigation.php on line 82
  • Jepps98
  • Graduate
  • Graduate
  • User avatar
  • Joined: Nov 28, 2004
  • Posts: 149
  • Loc: Umm, not exactly sure...
  • Status: Offline

Post July 16th, 2007, 6:26 am

Okay, here is my question >.>

I have installed IIS (through Control Panel), and when I go to http://localhost/, it says I need a password :cry:

Ive put in every password that I could think of, on every user account on my computer (damn parents) lol.

Anyways, here is a screenshot.

Image

Any help = me being greatful!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23407
  • Loc: Woodbridge VA
  • Status: Offline

Post July 16th, 2007, 7:44 am

Your Windows Login username and Password will work. However, that's the damndest thing. I've been using IIS for years and http://localhost/ has NEVER required a password, but damned if I didn't open localhost on my laptop just now and it asked for a password too. Has never done that. My Windows / Domain Admin username and password worked, but have no clue why it's asking for username and pass.

Going to have to look into that. It may just be because you haven't set up a website yet and the default is the iisstart page. Might be that they changed it to prompt for administrative password
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • Jepps98
  • Graduate
  • Graduate
  • User avatar
  • Joined: Nov 28, 2004
  • Posts: 149
  • Loc: Umm, not exactly sure...
  • Status: Offline

Post July 16th, 2007, 8:50 am

Well, on my computer there is no admin password (by Windows default of corse)

Still cant figure it out. Ive been messing with it for awhile now >.>.

You think that if I called a computer place (for instance dell, because my workstation is from dell), that they would be able to help?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23407
  • Loc: Woodbridge VA
  • Status: Offline

Post July 16th, 2007, 10:31 pm

have you tried your user name and leaving the password blank? Or just try Administrator and leave the pass blank.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • raananschwartz
  • Born
  • Born
  • No Avatar
  • Joined: Aug 03, 2007
  • Posts: 4
  • Status: Offline

Post August 11th, 2007, 5:14 am

Any more tutorials? like asp,net and such..
  • Jepps98
  • Graduate
  • Graduate
  • User avatar
  • Joined: Nov 28, 2004
  • Posts: 149
  • Loc: Umm, not exactly sure...
  • Status: Offline

Post September 24th, 2007, 7:43 am

ATNO/TW wrote:
have you tried your user name and leaving the password blank? Or just try Administrator and leave the pass blank.


I got this to work.. Sorry I didn't post earlier.
  • mmaderich
  • Born
  • Born
  • No Avatar
  • Joined: Oct 03, 2007
  • Posts: 4
  • Status: Offline

Post October 3rd, 2007, 7:31 am

Just wondering if I can, hopefully, get some help with this. I followed the steps here to get PHP and MySQL setup on my system, using IIS, so that I can run Helpdesk Reloaded for work. It's a Windows 2000 Server system, ISS 5.1 (if memory serves me correctly, I'm pretty 2K comes with IIS 5.1, not 5.0), PHP 5.2.4, and MySQL 6.0.2, also I have installed MySQL Tools 5.0 and phpMyAdmin 2.11.1. The install of Helpdesk Reloaded worked fine, database has all the information imported into it from local version I was running using EasyPHP. The login page wasn't coming up at first, but that was just because a config.php file didn't have the DB password in it, that comes up fine now. But now, whenever I go to log in it comes up that the page can not be displayed and the error code is "HTTP 405 - Resource not allowed." So, obviously, this is a problem with IIS, and I'm guessing it's not agreeing with some verbs. I currently have .php set to All Verbs, instead of Limit to, because I figured that should fix the problem, but alas, no go. So, any help would be greatly appreciated.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23407
  • Loc: Woodbridge VA
  • Status: Offline

Post October 3rd, 2007, 10:46 am

did you reboot the computer after reseting php to All Verbs? I've found after making a change to the config that's sometimes all it takes.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • mmaderich
  • Born
  • Born
  • No Avatar
  • Joined: Oct 03, 2007
  • Posts: 4
  • Status: Offline

Post October 3rd, 2007, 10:51 am

ATNO/TW wrote:
did you reboot the computer after reseting php to All Verbs? I've found after making a change to the config that's sometimes all it takes.


Rebooted it after each change I made, hoping that'd work, since it usually works for most things. Any other ideas?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 3rd, 2007, 10:51 am

Post Information

  • Total Posts in this topic: 142 posts
  • Users browsing this forum: No registered users and 193 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.