Yeodan Posted March 23, 2009 Share Posted March 23, 2009 <html> <?php $link = mysql_connect('localhost', 'root', '1234'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> </html> this little page makes my browser go: HTTP 500 Internal Server Error The website cannot display this page Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/ Share on other sites More sharing options...
premiso Posted March 23, 2009 Share Posted March 23, 2009 It is an issue with your webserver. Either look at your http.conf. php.ini or any .htaccess file. Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791847 Share on other sites More sharing options...
Yeodan Posted March 23, 2009 Author Share Posted March 23, 2009 It is an issue with your webserver. Either look at your http.conf. php.ini or any .htaccess file. I can only find php.ini no idea what to look for either Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791852 Share on other sites More sharing options...
lonewolf217 Posted March 23, 2009 Share Posted March 23, 2009 what if you have a page with basic html <html> <body> 'Sup World! </body> </html> Does this load ? Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791853 Share on other sites More sharing options...
Yeodan Posted March 23, 2009 Author Share Posted March 23, 2009 what if you have a page with basic html <html> <body> 'Sup World! </body> </html> Does this load ? yes <?php echo "hello" ?> also works it's just when I try to connect to mysql that I get the error I got the same error for making syntax mistakes in my code, but I don't have any now Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791860 Share on other sites More sharing options...
Yeodan Posted March 23, 2009 Author Share Posted March 23, 2009 I just found this is my apache error log [Mon Mar 23 17:19:24 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function mysql_connect() in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\test.php on line 3 what does that mean and how do I fix it? Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791890 Share on other sites More sharing options...
lonewolf217 Posted March 23, 2009 Share Posted March 23, 2009 load the phpinfo page. does it show you have mysql configured ? <?php phpinfo(); ?> you can also check your PHP.ini file Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791895 Share on other sites More sharing options...
Yeodan Posted March 23, 2009 Author Share Posted March 23, 2009 load the phpinfo page. does it show you have mysql configured ? <?php phpinfo(); ?> you can also check your PHP.ini file check it for what? I'm new to this stuff Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791899 Share on other sites More sharing options...
lonewolf217 Posted March 23, 2009 Share Posted March 23, 2009 google for how to check if php and sql are configured correctly and there are lots of tutorials on it Quote Link to comment https://forums.phpfreaks.com/topic/150724-solved-connecting-to-mysql-gives-me-an-internal-error/#findComment-791900 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.