paul_ Posted January 29, 2007 Share Posted January 29, 2007 hi allI have just install apache 2.2.4 , PHP 5 and Mysql 5.0.27 on winxp home. Heres the problem when i run a connection script to connect to the mysql db and select a db, all thats coming up is a blank page. When i put the script on my host server it say "cant connect to db " etc etc which running on my own pc is not doing.Any idea why its not putting text up letting me know if anthing is wrong.Thanks inadvancePaul Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/ Share on other sites More sharing options...
chronister Posted January 29, 2007 Share Posted January 29, 2007 try connecting using commandlinestart->run->type cmd A command prompt opens.cd "c:\...... your path to mysql/bin here."then run mysql -u USERNAME -p [enter]it should prompt you for a password..If that works then you have installed and configured it correctly Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172221 Share on other sites More sharing options...
trq Posted January 29, 2007 Share Posted January 29, 2007 [quote]Any idea why its not putting text up letting me know if anthing is wrong.[/quote]You need to enable [i]display errors[/i] in your php.ini. Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172230 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 yes it works, but why aint it displaying the text saying "cant connect to db" etc like on my host server :'( Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172232 Share on other sites More sharing options...
trq Posted January 29, 2007 Share Posted January 29, 2007 Post your code. Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172234 Share on other sites More sharing options...
Asheeown Posted January 29, 2007 Share Posted January 29, 2007 Make a php file and put the code[code]<?phpphpinfo();?>[/code]name it whatever you want, put it in your root folder and browse to the page, and look for the section labeled mysql, if it is there than it is simply a problem with the information you provided for the database connect Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172235 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 [quote author=thorpe link=topic=124600.msg516502#msg516502 date=1170110493][quote]Any idea why its not putting text up letting me know if anthing is wrong.[/quote]You need to enable [i]display errors[/i] in your php.ini.[/quote]Done that still dont work, still show a blank page even though the connection detail are worng so it show , access deined etc Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172239 Share on other sites More sharing options...
Asheeown Posted January 29, 2007 Share Posted January 29, 2007 Run the script I posted and see if mysql is interacting with php Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172240 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 [quote author=Fearsoldier link=topic=124600.msg516507#msg516507 date=1170110737]Make a php file and put the code[code]<?phpphpinfo();?>[/code]name it whatever you want, put it in your root folder and browse to the page, and look for the section labeled mysql, if it is there than it is simply a problem with the information you provided for the database connect[/quote]NO Mysql sections listed Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172244 Share on other sites More sharing options...
Asheeown Posted January 29, 2007 Share Posted January 29, 2007 That means Mysql is not working with php properly what operating system are you running this on? Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172246 Share on other sites More sharing options...
boo_lolly Posted January 29, 2007 Share Posted January 29, 2007 there's probably a few issues. check to see if you have a php_mysql.dll file anywhere. if so, tell us where. also look in your php.ini file and uncomment the line that says [code]extension=php_mysql.dll[/code]if it has a semicolon in front of it, delete the semicolon, save it. restart apache. Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172250 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 [quote author=Fearsoldier link=topic=124600.msg516518#msg516518 date=1170111188]That means Mysql is not working with php properly what operating system are you running this on?[/quote]xp home Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172262 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 [quote author=boo_lolly link=topic=124600.msg516522#msg516522 date=1170111382]there's probably a few issues. check to see if you have a php_mysql.dll file anywhere. if so, tell us where. also look in your php.ini file and uncomment the line that says [code]extension=php_mysql.dll[/code]if it has a semicolon in front of it, delete the semicolon, save it. restart apache.[/quote]php_mysql.dll cant be found i did a search for it! Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172263 Share on other sites More sharing options...
JasonLewis Posted January 29, 2007 Share Posted January 29, 2007 you havnt installed it properly then. i suggest you get a program that has a bundle package which installs all 3, Apache, MySQL and PHP on your computer. http://www.wampserver.com Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172267 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 i have got the php_mysql.dll from mysql.com i have putextension=php_mysql.dll <<< in the php.iniand changed the extension_dir = C:\Program Files\PHP << where i have put the dlland then i restarted it but its still not working Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172296 Share on other sites More sharing options...
fert Posted January 29, 2007 Share Posted January 29, 2007 I believe php also requires libmysql.dll Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172297 Share on other sites More sharing options...
boo_lolly Posted January 29, 2007 Share Posted January 29, 2007 your PHP should probably be in C:\ not in Program Files. it really doesn't matter much, but it's much easier to keep track of. try this...create a test script... call it test.php[code]<?php //test.php echo "Hello, World!\n";?>[/code]and place that file in C:\Program Files\PHP\then...[code]run: cmdC:> cd C:\Program Files\PHPC:\Program Files\PHP> php.exe test.php[/code]if it prints 'Hello, World!' to the command prompt, then you've done something right =) ![quote]I believe php also requires libmysql.dll[/quote] you are correct. Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172316 Share on other sites More sharing options...
paul_ Posted January 29, 2007 Author Share Posted January 29, 2007 [quote author=fert link=topic=124600.msg516583#msg516583 date=1170113718]I believe php also requires libmysql.dll[/quote]Its working now but libmysql.dll was not required.Thanks for everyones answers they were great :D Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172319 Share on other sites More sharing options...
wildteen88 Posted January 30, 2007 Share Posted January 30, 2007 [quote author=paul_ link=topic=124600.msg516610#msg516610 date=1170114680][quote author=fert link=topic=124600.msg516583#msg516583 date=1170113718]I believe php also requires libmysql.dll[/quote]Its working now but libmysql.dll was not required.Thanks for everyones answers they were great :D[/quote]PHP most probably found another one somewhere else then. Most probably the libmysql.dll in the MySQL bin directory. Link to comment https://forums.phpfreaks.com/topic/36237-php-does-not-work-with-mysql/#findComment-172970 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.