PHP and Mysql

  vinnyo123 16:20 05 Dec 2005

I searched PCadvisors database for solution=didn't quite find it.

My info:
OS WIN2K-5.00.2195
PHP 5.0.5
IIS 5.0
Mysql 4.1

My questions?
I am running the above system stated above. The only problem I have is getting PHP scripts to communicate with Mysql. With some research I found out that PHP 5.0.5 does not come with PELC extensions."needed for data base support"

Is this correct?

Anyone know of the easiest way to find the extensions needed for my setup? "searched already and couldn't find right ones"

If yes also need simple instructions to install preferably win installer or easiest way to compile.

PS: I been using PHP scripts for awhile and they work.

Haven't really confirmed Mysql is working only by:
I can connect with Mysql Admin
And can connect with cmd line tool Mysql comes with.

As always thanks in advance.

  Taran 20:00 05 Dec 2005

This may not be what you want to hear, but my own thoughts would be to either roll back to the last 4x PHP or, better yet, install Apache with PHP and MySQL and keep your IIS for serious ASP-ing.

I never like running PHP under IIS. The results for some advanced scripting can be less than optimal, although for general work it's OK.

Call me old fashioned and yes, I know it works (ish), but for any serious work I like PHP and MySQL running on Apache and I keep ASP and .NET stuff running on IIS (sometimes ColdFusion too).

Another consideration is that PHP 5 is largely pointless to use at present unless you're ramping up your skill base for future development - you won't find many hosts offering it for quite some time and getting it to run on IIS (as you've found) is less than easy.

If you want to follow your current path post to that effect - we might have to start application mapping and all kinds of other junk. Any Googling will produce plenty of tutorials on this - some of them even work - click here

I'd suggest a simple WAMP bundle, change its listen on port settings to a port over 80 (ISS uses it by default) and off you go. Try click here for a 'proper' server and if you want help with it just ask.

How did you install PHP and MySQL ?

Have you installed phpMyAdmin click here or the excellent MySQL Administrator click here

A bit more info on what you installed and how you installed it would help. I'm assuming you chose the *shudder* CGI PHP installer.

  vinnyo123 21:13 05 Dec 2005

Installed PHP with WIN installer and same with Mysql.

PHP is running great on system as I am already using PHP scripts.

Yes also installed Mysql ADMIN and can access Mysql seems to be working also.

As I am at work right now, I'll get back with more so I can let your suggestions sink in and I can research your links more.

Also I have found that I can get it to work with the PELC extensions?

also rolling back PHP and changing over to Apache is definitaly out "live server"


  Taran 21:44 05 Dec 2005

I can understand you wanting to stick with what you have and know but why, if you don't mind my asking, is Apache a no-go ?

It isn't a 'live' server to the outside world. It is a 'live' server to serve your files locally, from your PC hard drive to a browser installed on it, just as IIS does.

Imagine it simply as another local server, broadly similar to IIS, but one that works perfectly with PHP and MySQL. Outside access for the general public is disallowed.

Anyway, onward and upward.

If you have PHP scripts working and MySQL also appears to be, what are the problems you have getting a valid connection to work ?

Are you getting any specific error messages ?

Ports or bindings not working or unavailable ?

Create a file and call it test.php

Copy this into it:




Save the file and put it into your IIS root.

Call the file into your web browser by typing the h t t p://localhost/test.php address (without the spaces between the h t t p)

You should get a long web page full of general server information and other junk. It will show your versions of PHP and MySQL as well as general status of both.

Of particular relevance is the part of the page reading:


PHP Core



I'm using MySQL 5.0.15 at present, but only because I have to teach it. All of my serious PHPing is done on the latest 4x PHP platform, since that is what every commercial host I use currently has installed and available.

More detail of your failed connections would be appreciated.


  Taran 21:57 05 Dec 2005

Try the pages at this link: click here

It shows you in simple steps how to connect to an example MySQL database. You can either set your test database up using the command line or by using phpMyAdmin or MySQL Administrator.

Once the database is set up, you should create a connection PHP file called dbconn.php or similar, containing your host name (localhost), database name, username and password.

You may need to alter the default username and password in MySQL. Standard is username root with no password, but if you want to lock things down a little, open your command prompt, open up a MySQL instance and use these commands to change your password and secure things (press Enter after each line):

mysql -u root mysql

UPDATE user SET Password=PASSWORD('enter your password here')WHERE user='root';


DELETE FROM user WHERE user=';

DELETE FROM user WHERE Host='%';



That gets rid of the MySQL wide open security problems and gives you a user password to boot.

Type exit then enter, the exit followed by enter again to exit the command line instance.

Ho hum.

Tell you what, I'll shut up now and wait for more info...


  vinnyo123 05:04 06 Dec 2005

Hmm interesting start using Apache as another local server but at the moment I don't have another server to spare or system resources on current server.

Why not change we'll: same reason as above no extra sever and don't want to knock web site down for days converting and learning Apache "not right now".

As for error! I am not really receiving an error. I can create a DB "Schema" with mysql Admin. But when I use PHP "install.PHP" to set up DB it's a no go. Trying to use PHP to set up all table's it needs for script to run.

NOTE: I am using free or purchased PHP scripts that comes with all files."I am not a programmer yet"

When I install these scripts and it is time for PHP to set up DB I get a blank page. "tried many different scripts"

And as I said the only thing I come up with is the PELC extensions. "do you believe this can be my problem?"

I have all accounts "users" "root" passwords setup on Mysql."defaults changed"

You said;
"Once the database is set up, you should create a connection PHP file called dbconn.php or similar, containing your host name (localhost), database name, username and password."

This sounds like the logical place to start to see if PHP can connect to Mysql.
I would try this can you post code for file: as I would do a search.

Thanks for your time, as I been a member of this forum for a long time. My first time I was here looking for info on a cookie or something.
Just keep self teaching myself.
Gotta love this technology :)

Thanks for your time.

  harristweed 09:40 06 Dec 2005

I remember I had a problem getting mysql to work with PHP. (I run apache) but the solution is probably the same. Full details here.

click here

Hope this helps.

  Taran 17:56 06 Dec 2005

"at the moment I don't have another server to spare or system resources on current server."

I'm not sure where we're going with this.

Aapche runs on any Windows PC a serves web pages back to the PC it's installed on.

True, it is used for about 65% (ish) of all live web servers around the world, but installing Apache on your own PC simply allows you to use it to serve your PHP pages to the web browser installed on your PC.

I always run both IIS and Apache on my Windows computers for site testing, where any ASP or .NET work goes through IIS and all of my PHP (most of my programming) runs on Apache.

However, let's move on since you want to run PHP through IIS.

Before we go any further, can you clarify one point for me: are you using this machine to serve pages to the outside world or is this purely a local server used to test pages and sites for your own viewing ?

Normally, you run the installer, edit the php.ini file so that the cgi.force_redirect PHP directive reads 0, then add the path to your PHP directory to your Environment Varables, give IUSR_your_computer_name full control access permissions for the php.ini, docroot, and session tmp directory as a bare minimum, and then restart your PC or at least stop and restart IIS.

There are one or two other things you could do as well, but the above will get you up and running.

Or you could uninstall MySQL and PHP using Add/Remove Programs, download the DeveloperSide.NET Apache bundle click here , install it (usually takes less than three or four minutes) and start PHP-ing to your hearts content.

If you want more info post again with dertails of what you are using the server for.

I realise it's none of my business, but I can't help being curious why any change from your current setup is so out of the question.

  vinnyo123 04:01 07 Dec 2005

yes it is a live server "outside world"; serving web page and using PHP forms, PHP guestbook etc.

also I am running an IRC "server software" same machine.

And looking to implement Mysql DB to expand on website abilities.

you keep quoting
"I realise it's none of my business, but I can't help being curious why any change from your current setup is so out of the question."

Let me try to explain hmmmmm.
It takes awhile as you know to configure a server,firewalls,router,dns,php,scripts etc. and build & host a site. I don't think I have time right now to start on APACHE. I would like to just get PHP and Mysql interacting with each other for now.I believe I am just one or two configurations away from that.Then maybe I will have time to learn and grow.

  swapper 07:12 07 Dec 2005


  Taran 17:09 07 Dec 2005

I'd have refrained from most of the above.

This is going to seem incredibly churlish of me, but...

I'd rather not go any further.

I can give you literally thousands of reasons why not to run your own home-rolled web server, and a lot of reasons why not to run one with PHP5, and even more why not to do so when you clearly have a lot of question marks over the basic nuts and bolts of it all.

The risks of running the server to the outside world are yours, but I don't really want to get into that mire and believe me, it is just that.

Success is all well and good but most home rolled web server successes are tempered by spectacular failure, often resulting in key information being accessed during the process.

Windows 2000 and IIS 5 were never meant as a live web server environment - they are strictly intended for testing, as are Windows XP Pro and IIS 5.1.

If you happen to be running Windows 2000 Server, you're in a slightly better position, but only slightly.

I genuinely wish you good luck with it, but I am not going to be seen as the one who encouraged it.


This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Honor 9 Lite review

How Social Media has Propelled Political Graphic Design and Art in the Last Decade

The best kids apps for iPhone & iPad 2018

HomePod d’Apple : date de sortie, prix et fiche technique