Jump to content

[SOLVED] MySql, PHP and Vista


Cat

Recommended Posts

I'm having serious problems with PHP and MySql on Vista... pull my hair out problems... I've used the installer and it(MySql) shows up in my programs.  I can run it from the command line or at least I can put the password in and it tells me it's there and running - I'm a gui kind of girl and I always use phpMyAdmin so I haven't delved too far into if things are actually fully working... can't make phpMyAdmin work either but lets not go there right now  :P PHP is for sure working, I can bring up the info page using <?php phpinfo(); ?>

 

Here is where I discovered the two aren't talking... there's no MySql section in my php info page - I tried a mysql_connect() command as well and got an error message for my trouble.  I've googled myself insane all night and after trying and retrying everything I could find I have not been able to make it all work.  If anyone knows where I can find some detailed step by step idiot proof instructions I'd be more than happy to start all over again, rip it all out and reinstall - reconfigure and do all the other things necessary to make this work.  Vista is not my friend, it took me a couple of hours tonight just to figure out how to access the real administrator account just so I could alter the php.ini file.

 

Any assistance you can give me would make my little world a far better place :)  Thanks

 

Cat

 

 

After posting I see that there's an installation and configuration board that I hadn't noticed, if someone would like to move this there for me that would be lovely.

Link to comment
Share on other sites

have you uncommented

 

;extension=php_mysql.dll

;extension=php_mysqli.dll

 

in the php.ini? I have my stuff working on vista no problems. I'm running a tweaked x64 (turned off UAC, integrity checks off, etc.), but it should work even then. (You may have to set the security settings to allow non-admins all privileges or make yourself the owner of those folders).

Link to comment
Share on other sites

I hadn't uncommented ;extension=php_mysqli.dll but the other I had as well as extension=php_mbstring.dll which I read somewhere to do.  After making the changes I'm still not seeing a section in my phpinfo file showing mysql settings and am still getting the "call to undefined function" error when using mysql_connect()  Thanks :)

 

Cat

 

Link to comment
Share on other sites

Oh, I told you to uncomment them both because somehow I thought you might have been mysqli_* functions... my bad. It's only important to have ;extension=php_mysql.dll uncommented in this case.

 

What version of PHP are you running?

 

It might be that in your php.ini file, your extension_dir isn't correct, or that it's having trouble loading the module. First check that. This is what mine looks like:

 

  extension_dir = "C:\Development\ENVIRONMENT\php523"

 

If that doesn't work: turn this directive on in php.ini:

 

  display_startup_errors = Off

 

Then run php on the command line and see if it throws you any startup errors.

 

If no errors arise, try adding the -m argument on the command line

 

  php -m

 

and see if the mysql module is installed.

Link to comment
Share on other sites

Mine is extension_dir = "c:\php\ext" I have my php directory at my root and I believe the extensions are in the ext folder... this is another thing I read to do online.  I'm currently running 5.2.3 but the directory is only called php.  Thanks.

 

Cat

Link to comment
Share on other sites

Oh ok, then do the other two suggestions I added to my previous post, and it should tell you more about what is going on.

 

If that doesn't work: turn this directive on in php.ini:

 

  display_startup_errors = Off

 

Then run php on the command line and see if it throws you any startup errors.

 

If no errors arise, try adding the -m argument on the command line

 

  php -m

 

and see if the mysql module is installed.

 

If you continue having problems, you may have to redownload the php package and get fresh copies of the DLLs.

Link to comment
Share on other sites

Oh! Another possibility is that it's not looking at the correct php.ini file! Check your phpinfo(); page and see if the Configuration File (php.ini) Path points to the correct one.

Link to comment
Share on other sites

Ok so far nothing is making this work, this may be a stupid question but how do I run php from the command line in windows?  I tried getting the dos shell (cmd) to come up and then typing php -v but I got the error 'php' is not recognized as an internal or external command, operable program or batch file.  I also tried using the php.exe since what I could google on the subject pointed to this being where you ran your command line code relating to php from but nothing I type in there results in anything happening.  Thanks for all your help.

 

Cat

Link to comment
Share on other sites

Ok think it may be worked out but I have to get some sleep before I really test it... looked at another post here and saw that someone changed their path variable to try to get it working and once I did that the command php -v and php -m ran from cmd... mysql is there as one of the modules as is mysqli and when I run mysql_connect I still get an error but it's a different one have to work on it tomorrow :)  Thanks for all your help I'll let you know if it's working

 

Cat

Link to comment
Share on other sites

Heya,

 

Sorry I had left for the day--anywho, yes that was what I would've suggested to get PHP working on the commandline: adding your PHP directory to the Path environment variable. (tutorial to do so can be found here: http://www.php.net/manual/en/faq.installation.php#faq.installation.addtopath)

 

But if you say mysql appeared as one of the modules, but isn't working, this is very likely that you have either a corrupted dll or dependency (a file that the dll relies on).

 

You may want to head to http://www.php.net/downloads.php and download the PHP 5.2.3 Zip Package, then look for these two files

 

  libmysql.dll (should be in the root or in the /ext/ folder)

  php_mysql.dll (should be in the /ext/ folder)

 

And use those copies to overwrite your current copies.

 

That's all I can think of right here and now. Tell me how it works out!

Link to comment
Share on other sites

All good now after adding the path... sort of... lol but as far as php and mysql chatting eachother up everything is running fine.. now for my phpmyadmin challenges but that is another post entirely :)  Thanks for all your help

 

Cat

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.