Posts: 306898 Topics: 12466 LOGIN

Home >> Computers Hardware&Software >> problems connecting php to mysql??

26.12.2007, 16:59 quote

Anonymous

I have downloaded the latest versions of Apache, PHP and mysql. Have PHP connected to Apache okay, but cant seem to connect to mysql, keep getting an http500 error. Looked in all the books I have and searched the net, but cant seem to connect.

Any help will be gratefully received..thanks.

 

26.12.2007, 18:24 quote

Anonymous

Jeggae wrote:
I have downloaded the latest versions of Apache, PHP and mysql. Have PHP connected to Apache okay, but cant seem to connect to mysql, keep getting an http500 error. Looked in all the books I have and searched the net, but cant seem to connect.

Any help will be gratefully received..thanks.


mate, your are going above my league, if it is possible to contact their customer service, i know they probably wont answer until the festivities are finished, but probably also got the answer on their website

 

26.12.2007, 19:55 quote

kebabman
kebabman Joined: 03 Jan 2007 Posts: 931 Location: United Kingdom, England, Lancashire
View user's profile Visit poster's website

Jeggae wrote:
I have downloaded the latest versions of Apache, PHP and mysql. Have PHP connected to Apache okay, but cant seem to connect to mysql, keep getting an http500 error. Looked in all the books I have and searched the net, but cant seem to connect.

Any help will be gratefully received..thanks.


What OS are you running this setup on?

How are you trying to connect to the database?

Have you nmap'd 127.0.0.1 (presuming you are running the server on your local michine) to check if the mysql port (3306 usually) is open?

Souds like it could be a problem with your mysql config file but can't be sure.
_________________

 

26.12.2007, 20:27 quote

Anonymous

You need to enable socket / TCP/IP connections in my.cnf

check out the examples on mysql.com

you can also print out the error mesages you get as a result for a more detailled error message.

 

27.12.2007, 10:47 quote

Anonymous

Jeggae wrote:
I have downloaded the latest versions of Apache, PHP and mysql. Have PHP connected to Apache okay, but cant seem to connect to mysql, keep getting an http500 error. Looked in all the books I have and searched the net, but cant seem to connect.

Any help will be gratefully received..thanks.


Are you running this setup as a local server? If so, you could do a lot worse than just using a one-click install setup like EasyPHP, xampp, etc. Not the way I'd go (I'd install the individual components too), but I do use the latest Beta version of EasyPHP on a USB stick when I go away to test my database driven sites (it doean't need to be on a USB stick of course!). EasyPHP 2 Beta 1 works fine and includes these components: Apache 2.2.3 - PHP 5.2.0 - MySQL 5.0.27 - PHPMyAdmin 2.9.1.1 - SQLiteManager 1.2.0

 

27.12.2007, 20:42 quote

Anonymous

Thanks chaps, I will try the things you have advised.

Someone on another site mentioned xampp, I installed it and had the same problem so uninstalled it. I will look into EasyPHP.

All part of the learning process Smile

 

27.12.2007, 20:47 quote

Anonymous

Jeggae wrote:
Thanks chaps, I will try the things you have advised.

Someone on another site mentioned xampp, I installed it and had the same problem so uninstalled it. I will look into EasyPHP.

All part of the learning process Smile


I often suggest EasyPHP, mainly because it is idiot proof (not that I think you're an idiot of course!), but it does have the advantage of working 'out of the box', which saves a lot of frustration when starting out with this kind of technology, and offers a reasonably easy learning curve towards the 'real thing', if that makes sense.

If you do try EasyPHP, any probs, gimme a nudge.

 

27.12.2007, 20:57 quote

Anonymous

Incidentally, when I tried running a new CMS script on my local server the other day I found out that there was a small compatibility bug between the latest releases of MySQL and PHP, which most people seem to have got around by downgrading from PHP 5.2 to PHP 5.1.2 – unfortunately, I can’t for the life of me remember what the bug was (but it did affect connection to MySQL), or which PHP patch I used, sorry.

 

27.12.2007, 21:03 quote

Anonymous

darkhorse57 wrote:
Jeggae wrote:
Thanks chaps, I will try the things you have advised.

Someone on another site mentioned xampp, I installed it and had the same problem so uninstalled it. I will look into EasyPHP.

All part of the learning process Smile


I often suggest EasyPHP, mainly because it is idiot proof (not that I think you're an idiot of course!), but it does have the advantage of working 'out of the box', which saves a lot of frustration when starting out with this kind of technology, and offers a reasonably easy learning curve towards the 'real thing', if that makes sense.

If you do try EasyPHP, any probs, gimme a nudge.


Thanks Stu, I'll have a go at it over the weekend and let you now how I get on.

 

30.12.2007, 00:20 quote

beddo
beddo Joined: 15 Oct 2006 Posts: 290 Location: United Kingdom, England, Merseyside
View user's profile Visit poster's website

500 error could mean a lot of things from the server not being configured through to bad permissions on scripts or a typo.

EasyPHP and the likes are good if you're just wanting to learn the language. If you're actually wanting to do something proper though, its always best to program direct on the hosting system as configuration differences can be a killer. I once had two systems (test and live) supposedly configured the same yet the test one obeyed the standard php upload command and the live wouldn't. I had to manually write the upload to temp, copy and delete temp to get it to work!

 
 
Jump to:

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 vote in polls in this forum