PDA

View Full Version : PHP/MySQL/phpMyAdmin help


Pages : [1] 2

superklye
12-27-05, 02:47 AM
I'm trying to set up a site that uses a database for dynamic content management, and this is my first time with PHP and MySQL. I seem to have both installed correctly, and am trying to use phpMyAdmin to administer my SQL databases.

I've downloaded all of them and have set up IIS 6.0 as my web server, however, the phpMyAdmin needs to be set up before using. The instruction say to use the setup.php file located in the scripts directory.

Except: that file isn't there! So I can't get into phpMyAdmin and I have no idea what I'm doing with the commandline for MySQL, though I did set up a new database just fine.

But this tutorial uses phpMyAdmin a ton and it seems to be MUCH easier than command line crap. Does anyone have any experience with it and can offer some help to get this set up? I'm at my wits' end, I want to go to bed, but I'm too pissed and want to get this working before I do, since I've wasted almost 3 hours now.

superklye
12-27-05, 03:19 AM
Fantastic. Now I can't open a single ****ing PHP file. I found some stuff about enabling the mysql.dll or whatever so that the PHP server would connect PHP files to mysql and since I've done that (by creating the php.ini in the C:\PHP folder and adding it as an environment variable in Windows as the instructions told me to), every time I try to open a PHP page, I'm asked to download it or open it with a file. If I choose FireFox or IE, it just opens a new window and says I need to download or open.

This is ridiculous. I just want a damned guide that tells me how to set this up USING FILES THAT EXIST and explain things for those of us that aren't hardcore programmers. Jesus. What a pain in the ass.

rewt
12-27-05, 08:29 AM
I've never used PHP with IIS myself. Sorry I can't help much there (I have most experience with Apache web server).. but it sounds as if your IIS web server is not associating the .php files with the php compiler/interpreter. Hence the reason it asks you to download it, and not compiling it and displaying it on the user's browser window like it is supposed to do.

I found a couple links on google that might help

http://www.google.com/search?hs=PUD&hl=en&lr=&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&q=php+iis&btnG=Search

Check out "PHP IIS installation on Window XP (http://www.plus2net.com/php_tutorial/php_iis_installation.php)." You may be using Server 2003, but the method will probably be similar to that of the article.

Good luck :)

supra
12-27-05, 09:03 AM
anyone reason why your running IIS? Cos I reckon there isnt really any point running IIS unless you want to run asp/.net stuff. I would go with apache. Much easier to install & configure

superklye
12-27-05, 09:33 AM
Well, I found some things about running IIS/PHP and it seems to be working, but it keeps asking me for a password now when I try to login to phpMyAdmin. I don't remember ever setting a password for anything, so I don't know.

And I used IIS because it seemed that it was easier than using Apache for PHP, at least from what I was reading, because everyone was saying that Apache doesn't support PHP or MySQL out of the box, that you have to configure it and I was fed up enough with all the crap I was having to do for IIS.

So I don't know. Tonight, when I get home from work, I'll give it another whirl with IIS, but if it keeps acting like this, then I'm going to try something else.

superklye
12-27-05, 09:44 AM
I've never used PHP with IIS myself. Sorry I can't help much there (I have most experience with Apache web server).. but it sounds as if your IIS web server is not associating the .php files with the php compiler/interpreter. Hence the reason it asks you to download it, and not compiling it and displaying it on the user's browser window like it is supposed to do.

I found a couple links on google that might help

http://www.google.com/search?hs=PUD&hl=en&lr=&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&q=php+iis&btnG=Search

Check out "PHP IIS installation on Window XP (http://www.plus2net.com/php_tutorial/php_iis_installation.php)." You may be using Server 2003, but the method will probably be similar to that of the article.

Good luck :)
And thanks for the links. I'll give those a look and see what I can figure out. And I'm using XP Pro...not Server 2003.

rewt
12-27-05, 10:47 AM
And thanks for the links. I'll give those a look and see what I can figure out. And I'm using XP Pro...not Server 2003.

No problemo.

I thought you meant Windows Server 2003 because you said IIS 6.0. XP Pro uses IIS 5.1 AFAIK.

nemecb
12-27-05, 11:22 AM
The password it's asking for is one of your mysql users. You can set the authorization type in config.inc.php (IIRC) in the phpmyadmin directory. I've always used cookie authentication to get it to work right, but the others would probably be okay too they just didn't work for me.

superklye
12-27-05, 11:33 AM
No problemo.

I thought you meant Windows Server 2003 because you said IIS 6.0. XP Pro uses IIS 5.1 AFAIK.
Yeah, you're right. I realized that this morning...it is indeed 5.1.

And the links you gave...I have already done that stuff. :( Still gonna have to keep searching, I guess.

superklye
12-27-05, 11:37 AM
The password it's asking for is one of your mysql users. You can set the authorization type in config.inc.php (IIRC) in the phpmyadmin directory. I've always used cookie authentication to get it to work right, but the others would probably be okay too they just didn't work for me.
Well, I have a MySQL password, but no username. And when I try to login it first asks for the password for ** on “localhost” (I think that’s what it’s saying for the **…it may be something else, such as “”, but that’s what it looks like), and if I put in the password with no username, another prompt comes up asking for the localhost on “localhost” username and password.

I changed the password that was in IIS…it was some default thing that I had no idea what it was and used my computer’s name, since that was the name in there, but it got me nothing.

I’ll look at the config.inc.php. I had to download v2.64 of phpMyAdmin because neither that file nor the scripts/setup.php were included with 2.71. And 2.64 STILL didn’t have the setup.php. It’s annoying that their own directions, included both with the download and on their site say to use that file and IT DOESN’T EXIST!

I assume that file allows me to setup up the config.inc.php file, or I can just open it in Dreamweaver and edit it in there. However, I’m not exactly sure what all the of fields/variables should be, nor am I familiar with the coding conventions of PHP. Looks like I’ll be doing a little crash course in PHP from w3schools at lunch today.

nemecb
12-27-05, 12:56 PM
For the username try mysql or root. I think root was the only user created by default when I installed mysql. The password defaulted to blank, although the first thing I did after installation was change it using the command-line interface.

Oddly enough, the only place that setup.php appears in my installation is in the libraries/dbg/ directory in phpmyadmin. Seems like a strange place to put it.

config.inc.php is pretty well commented and you shouldn't need to know much PHP to alter it (just enough to figure out that the values you change are between the "s;)). Mostly it's just some trial and error to figure out which settings actually work for your situation. A lot of them are fine at their default values too.

superklye
12-27-05, 01:11 PM
Yeah, most of them were just blank "" so I figured I put my password in there.

Now, in the php.ini file (which I had to create using the php.ini-inc file (I think that’s what it was called), I followed what a tutorial in Macromedia’s devnet area for doing PHP in Dreamweaver said to do and it seemed to work, my only question is whether or not the conventions used in the ini file apply to actual PHP script coding as well.

There were a number of values I changed in the .ini that were originally something like

Blahblah_blah = “enter_value;”


But when I put the value in, they change from having quotes and/or a ; to just being:

Blahblah_blah = 1

Or something like that.

So, in the config.inc.php file, do I keep the “”s and the ;s or do I do it like the ini file? I mean, again, I could do trial and error, but I’d rather just know for sure instead of wasting time. Ya know?

And thanks for your continued help. Once I get everything setup, I don’t think I’ll have too many problems…it’s just all these passwords and configuring each of the servers, when I’ve never done it (and never set any passwords).

Also, I tried using “root” and the password I made for the MySQL database, but that didn’t seem to work. I dunno. I’ll give it another go when I get home tonight and see if I can figure it out and see if manually changing/adding passwords to the config.inc.php file helps.

That setup.php file you said was in a completely different location…is that the one they recommend to use for setting up the config.inc.php or is that a different file entirely?

nemecb
12-27-05, 02:18 PM
The php.ini file and config.inc.php file have different syntaxes. You'll want to leave everything as-is and only change the values. For example, here's an excerpt from mine:
$cfg['Servers'][$i]['host'] = 'nemebean.homelinux.com'; // MySQL hostna
me or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank
for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leav
e blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL s
erver ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension t
o use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol f
or the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = '********'; // MySQL control user sett
ings
// (this user must have read
-only
$cfg['Servers'][$i]['controlpass'] = '*********';
So the 's and ;s need to stay.

I think you may need to configure the config.inc.php file before it will let you login. It needs the username and password of some mysql user (the control user above) to check the password you enter against the user database.

Looking at the setup.php file that I have it looks like it wouldn't do anything useful. It's just for loading the dbg extension or something. If you have a config.default.php file you can try just copying that to config.inc.php and editing that. It sounds like that's essentially what the setup.php file does anyway (I don't think I ever used setup.php either so I'm not sure WTF that is all about - it's been a while though so I could be wrong).

Hmm, interesting. Apparently setup.php wasn't supposed to be included until 2.7.1. Since that's not out yet there is definitely something screwy with their documentation. I guess it's generated nightly from their current development version, but that does users no good. Somebody's asleep at the switch. Anyway, I see that the current zip file does include config.default.php, so you should be able to edit that by hand and get it working.

You're right that once you get this set up it will be much simpler to administer. Once you get it going enough to login you can configure almost everything from phpmyadmin.

superklye
12-27-05, 02:26 PM
Fantastic...thanks yet again. :) I'll go through all this when I get home. From what I've seen of screenshots and stuff, this seems to be a SUPER easy way to administer MySQL databases and such. It looks really clean and simple, so I'm really looking forward to getting it working.

I did a little command line stuff with the MySQL Manager and it wasn't that hard, but I'm a visual person, so I couldn't see myself doing a ton from there. I created a new database, but that was it...I realy wanted to get everything else set up. There are no tables or anything in it yet, just the empty database.

But yeah, anyway...I'll check this out more when I get home. Thanks. :)

nemecb
12-27-05, 02:52 PM
No problem. I don't really do all that much with my databases so I've never seen any reason to learn how to do things from the command-line (even though I generally like to use it) and I suspect there's no advantage to that over phpmyadmin anyway. The only time I do use it is when I break something and can't login to phpmyadmin. Those are always tense moments.:)

superklye
12-28-05, 12:33 AM
yeah, I went into the config.inc.php file, changed all the username instances I could find to root and put the password the same for all of them and it STILL won't let me in.

I updated the server location and all that.

I'm sure this is a wonderful program and everything, but I'm quickly getting to the point of not caring because it's not worth the headache.

nemecb
12-28-05, 12:54 AM
Which auth_type do you have set (the $cfg['Servers'][$i]['auth_type'] value)? I think mine defaulted to HTTP which didn't work.

It might also help to check if your mysql users' permissions are set correctly. On Linux you can do that with mysql -u root -p -e "select * from user" mysql. I'm not sure that will translate directly to Windows, but I think it should. It should prompt you for your password and then print out a big table of your users and their privileges. You should probably have a % in the first column next to your root user. If you don't that may be a problem.

The thing with phpmyadmin is that there are so many variables. You don't know whether it's one of the config.inc.php settings that is wrong or a mysql setting or something else. Makes it hard to troubleshoot starting out.

superklye
12-28-05, 01:29 AM
Which auth_type do you have set (the $cfg['Servers'][$i]['auth_type'] value)? I think mine defaulted to HTTP which didn't work.
It's set to "config"

It might also help to check if your mysql users' permissions are set correctly. On Linux you can do that with mysql -u root -p -e "select * from user" mysql. I'm not sure that will translate directly to Windows, but I think it should. It should prompt you for your password and then print out a big table of your users and their privileges. You should probably have a % in the first column next to your root user. If you don't that may be a problem.
Yeah, nothing worked. I tried all sorts of combos of what you typed, I made sure I was in the right database...nothing. The MySQL command line just kept spitting back errors at me.

The thing with phpmyadmin is that there are so many variables. You don't know whether it's one of the config.inc.php settings that is wrong or a mysql setting or something else. Makes it hard to troubleshoot starting out.
Yeah, it really does. Sigh... tyring to do this after a 12.5 hour day of work probably isn't the best idea. I exhausted and I'm just getting pissed off that I can't figure this out.

superklye
12-28-05, 02:01 AM
Should the MySQL database be on a certain port? Right now it's on 3306 and I don't know if/where I make PHP look for that.

And is there anything in the MySQL my.ini that I need to edit? I haven't really seen anything say that there are any variables in there that need to be changed, but I dunno...I really thought it was going to be much easier than this. :-\

superklye
12-28-05, 02:08 AM
I just don't get this. I don't know where it's looking for a password/username. It keeps saying

Enter username/password for "" at localhost

and when I cancel

Enter usernma/password for "localhost" at localhost.

wtf does that mean? My IIS stuff doesn't work, and I don't recall ever setting one up anyway, since I wasn't asked to.

I don't want to use apache, but I think I may have to if this doesn't get resolved quicklike.

nemecb
12-28-05, 09:42 PM
I'm afraid IIS is a bit out of my range of experience. I would know what to look for on Apache, but I've never even seen an IIS server.

superklye
12-29-05, 12:08 AM
That's fine. I've got a few people at work I'm talking to, and I got a couple links. I'm going to give it a whirl, but not for a few days, probably. Work has been absolutely ridiculous. I do web design all day (11+ hours lately) and the last thing I want to do is come home and design more sites, ya know?

So again, I appreciate all your help. I'll see if I've got the energy for this tomorrow, which shouldn't be such a ridiculous day.

And the links are here, by the way:
http://phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=install-phpmyadmin.html

http://www.trap17.com/index.php/installing-apache-mysql-phpmyadmin-locally_t31163.html

superklye
12-30-05, 12:55 AM
I finally had it, uninstalled IIS and am in the process of installed Apache 2.0.55 for Windows. There seems to be a plethora of info for phpMyAdmin/MySQL/PHP and Apache out there, so I'm going to stop fighting it and just use it.

/sigh

The headaches this has caused are really making me never want to do web design again.

supra
12-30-05, 01:46 AM
You dont have to uninstall IIS. I run apache & IIS together. Just change the port number for 1 or your servers. I run IIS on 80 & apache on 81. ;)

Out of all the webservers I have tried. IMO, apache is the most stable & highly configurable.

superklye
12-30-05, 01:56 AM
pfft...eff IIS. It wasn't letting me do anything. I couldn't view a single thing in inetpub/wwwroot. It kept asking for a username/password that didn't exist because it never told me to create one in the first place.

Apache is awesome, so far. I haven't tried to run phpMyAdmin yet, but I set up a simple db/table in MySQL and wrote a script for it that appears to be working exactly as it's supposed to, so I'm quite happy about this. :)

I wish I would've done Apache first. Man, what a total unnecessary mind**** this all was.