megashell Posted June 12, 2006 Share Posted June 12, 2006 I installed apache, php, and mysql on my computer...whenever I have a php page that connects to a mysql database, everything works fine except the page continues to "load" even after it's done. Even if it's just simply connecting, then disconnecting, the page will load forever, plus php-cgi.exe is opened ( I see it in my taskmanager) for every page that does this. So if I go to 5 different pages that use mysql, they never stop loading, and I'll have 5 php-cgi.exe's open in my task manager until I manually close them. What's wrong??thanks! Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/ Share on other sites More sharing options...
WendyLady Posted June 12, 2006 Share Posted June 12, 2006 It sounds like you have a never-ending loop somewhere in your code. I did this once by mistake, and the results were very interesting. Sorry I can't remember what caused it -- maybe someone else can, or if you post the problematic code someone can help you out.Wendy Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/#findComment-44777 Share on other sites More sharing options...
megashell Posted June 13, 2006 Author Share Posted June 13, 2006 No, no loop. This is all it is:<?$dbusername="user";$dbpassword="pass";$dbdatabase="db";$db="localhost";mysql_connect($db,$dbusername,$dbpassword);@mysql_select_db($dbdatabase) or die( "Unable to select database");print("Done.");mysql_close();?> Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/#findComment-44787 Share on other sites More sharing options...
poirot Posted June 13, 2006 Share Posted June 13, 2006 Things... 1. Instead of the shorthand <? ?> use <?php ?>. This ensures better compatibility with all OS' and configurations2. Are you sure the database is on? It may be trying to reach a database that is not running or not reachable - although the script should abort after reaching max_execution_time3. Will it display the message "Done"? Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/#findComment-44811 Share on other sites More sharing options...
d_barszczak Posted June 13, 2006 Share Posted June 13, 2006 It may be your installation that is set up slightly wrong but it could be either mysql, apache or php so to eliminate php have you tried a simple echo "Hello World"; script.Do your html files display ok.Or is it just when you attempt to use mysql. Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/#findComment-44903 Share on other sites More sharing options...
megashell Posted June 13, 2006 Author Share Posted June 13, 2006 I'm pretty sure it's not my code that's wrong. I've put PHP My Admin on there, and a PHPBB Forum, and it all works fine (connects to the database, gets stuff, etc.) but all of it is never-ending loading. A regular *.html or *.php file (with simply <? print("test"); ?>) works fine...it displays test and then stops loading. The only time I have problems is when it connects to mysql database. Even with the phpmyadmin, I can view the tables and data, but it never stops loading. I'm thinking it's something wrong with my mysql installation, but I have no idea what. Hopefully you guys do :) hehe. Any ideas?By the way...I'm using Apache 2.0.58, PHP 5.1.4, and MySQL 4.1. I used a help site to help me set it all up and walk me through the installation...it's tanguay.at or something like that. Couple of things that might be of some help in troubleshooting this...That site mentioned I should have a libmysqli.dll in my C:\PHP folder. I don't, I only have libmysl.dll. In my php.ini, I have the following extensions:extension=php_mysql.dll and extension=php_xsl.dllUnder the MYSQL section of the php.ini I have...mysql.allow_persistent = Onmysql.max_persistent = -1mysql.max_links = -1mysql.default_port =mysql.default_socket =mysql.default_host =mysql.default_user =mysql.default_password =mysql.connect_timeout = 60mysql.trace_mode = OffI'm guessing not having libmysqli.dll isn't a problem, since I think it's only MySQL Lite anyway, but I thought I'd mention it just in case.Okay, I found the site that I used to help me walk through the install...[a href=\"http://www.tanguay.at/installPhp5.php5?step=1\" target=\"_blank\"]http://www.tanguay.at/installPhp5.php5?step=1[/a] maybe that might help troubleshootThanks :) Quote Link to comment https://forums.phpfreaks.com/topic/11815-php-page-keeps-loading/#findComment-45017 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.