TUTORIAL: How to install PHP and MySQL on IIS

  • RickSavoy
  • Born
  • Born
  • RickSavoy
  • Posts: 3

Post 3+ Months Ago

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!
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • RickSavoy
  • Born
  • Born
  • RickSavoy
  • Posts: 3

Post 3+ Months Ago

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
  • RickSavoy
  • Posts: 3

Post 3+ Months Ago

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
  • esm
  • Posts: 6

Post 3+ Months Ago

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
  • bearhd
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: 149
  • Loc: Umm, not exactly sure...

Post 3+ Months Ago

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
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

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
  • Jepps98
  • Graduate
  • Graduate
  • User avatar
  • Posts: 149
  • Loc: Umm, not exactly sure...

Post 3+ Months Ago

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
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

have you tried your user name and leaving the password blank? Or just try Administrator and leave the pass blank.
  • raananschwartz
  • Born
  • Born
  • raananschwartz
  • Posts: 4

Post 3+ Months Ago

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

Post 3+ Months Ago

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
  • mmaderich
  • Posts: 4

Post 3+ Months Ago

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
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • mmaderich
  • Born
  • Born
  • mmaderich
  • Posts: 4

Post 3+ Months Ago

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?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

Have you seen this?
http://www.somacon.com/p126.php

It describes your error in IIS and provides resolutions.
  • mmaderich
  • Born
  • Born
  • mmaderich
  • Posts: 4

Post 3+ Months Ago

ATNO/TW wrote:
Have you seen this?
http://www.somacon.com/p126.php

It describes your error in IIS and provides resolutions.


Now, correct me if I'm wrong in this, but basically, what I'd do is replace where it says to choose asp.dll with php5isapi.dll, since I'm using PHP, not ASP for the page, and I'd setup php5isapi.dll for .php extension not the .html extension, yes? (Though, I tried for .html and .htm as well, just to see what would happen, and no go.)

Also, I discovered that if when I type in the URL, instead of going to http://www.domain.com , I go to http://www.domain.com/index.php it will let me login, but certain PHP scripts, when I go to certain pages, won't run, and part of the page will be blank.

I found one site that said that the cause of that is if you have Front Page setup in IIS, so I removed it, but it still happens.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

For the mapping I used .php ext c:\PHP\php-cgi.exe verbs "all". Have never had a problem with any php file.

I got that from here when I set mine up.
http://www.visualwin.com/PHP/
  • mmaderich
  • Born
  • Born
  • mmaderich
  • Posts: 4

Post 3+ Months Ago

ATNO/TW wrote:
For the mapping I used .php ext c:\PHP\php-cgi.exe verbs "all". Have never had a problem with any php file.

I got that from here when I set mine up.
http://www.visualwin.com/PHP/


Sorry for taking so long to respond. Well, I set up the server earlier to use PHP-CGI.exe, and once I finished configuring it because of the redirect, it still has the same exact problem. Anything else you can think of? (At this point, I'm thinking it might be easier to wipe it, install Fedora, then just yum install Apache, PHP, and MySQL.)
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

I seem to recall trying a couple programs once where I've got that error. Oddly I have about a dozen php apps running just fine on IIS with MySQL including phpMyAdmin, phpBB, and Coppermine as well as ones I wrote. I basically summed it up as something in the way the programs were written that IIS didn't like, couldn't figure out what, and just chucked the programs and found another solution.
  • magicmarc
  • Born
  • Born
  • magicmarc
  • Posts: 1

Post 3+ Months Ago

hi anto,
quick question, im following thesesteps to install the php/mysql onto my existing iis 5 server running on a windows 2000 sbs server i have here.
im wanting to add a moodle website to my server, in addition to my existing websites already on the server.

in order to run the moodle site ineed php and mysql.
my question is this, im installing php, and its asking what 'webserver setup'... what web server setup? 'do not setup a web server' since i already have my iis up and runnin fine?
thanks
marc
im very new to php, i had the wamp package running on a dedicated pc, but not an iis server previously!
thanks'
m
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

You know it's been nearly two years since I've set it up and I can't recall that part of the install. Perhaps someone with a more recent install experience could answer that for you.
  • AR|Groundzero
  • Born
  • Born
  • AR|Groundzero
  • Posts: 1

Post 3+ Months Ago

Thank you for your great tutorial.

I am having some issues with the php. I can run the test page and it works but no other .php pages will load?

Any suggestions?
  • phplunatic
  • Born
  • Born
  • phplunatic
  • Posts: 1

Post 3+ Months Ago

Hello there

First of all thanks for your tutorial. After four frustrating hours am more frustrated now(but every programmer goes through it), I've been trying to run php on windows xp machine which is used for development purpose. Am not sure where am going wrong. I have carefully followed the instructions in this tutorial but still am getting HTTP 500 error, Should I use php5isapi.dll for mapping purposes or php.exe? Sorry am totally confused and a newbie for php, so any help would be much appreciated.

Tons of thanks in advance
  • chris2699
  • Born
  • Born
  • chris2699
  • Posts: 1

Post 3+ Months Ago

I have followed your instructions to the 'T' and I am getting an error when I goto my browser:

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

I can not find any errors or a log file for that matter.

My php.ini you said to edit is not where you said it would be it is in the c:\PHP directory. Although I did modify it according to your instaructions.

Also I am running the defaulr web server on port a non standard port.

Any insite would be great

Thank you
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

If you didn't do the standard Windows Install, then you need to copy and paste the php.ini to C:\Windows
That should fix the errors once php.ini is in the correct place.
  • bettytech
  • Born
  • Born
  • bettytech
  • Posts: 4

Post 3+ Months Ago

//please do not repost copyrighted articles from blogs and other places. Link to them instead. Original blog post
http://www.bizpassion.com/?p=79
  • Shadxow
  • Born
  • Born
  • Shadxow
  • Posts: 2

Post 3+ Months Ago

i would first like to say awesome tutorial.

when i tried to follow it, i got to the part of installing php and got this error when trying to install it:

Image

Image

the error is in the second pic. it says "The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2878."

i have tried re-downloading the installer 3 times already, and ive disabled the bitdefender and registry mechanic programs that i have installed. i have also tried to restart the pc and none of those things helped.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23460
  • Loc: Woodbridge VA

Post 3+ Months Ago

This was apparently a problem with 5.2.5 and was reported November 9th here:
http://aspn.activestate.com/ASPN/Mail/M ... ev/3579705


This issue was addressed and closed by jmertic. Check this post posted yesterday from jmertic
http://aspn.activestate.com/ASPN/Mail/M ... ev/3579990

Apparently it's now fixed in the CVS but might take a few days for the installer. I'd suggest give it a day or two and download again, or if you want download the current CVS from the link provided in that post. If you aren't comfortable installing from a CVS, I'd suggest waiting until the installer is fixed.
  • Shadxow
  • Born
  • Born
  • Shadxow
  • Posts: 2

Post 3+ Months Ago

thxs for the quick responce. i dont mind waiting so ill just wait for the installer.

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.