PHP forums, MySQL forums, Web Development resources

Home PageHome    PHP ResourcesTopic List    FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups 
 RegisterRegister
    ProfileProfile    Log in to check your private messagesLog in to check your private messages    Download the RSS Reader RSS Feed Download the RSS Reader RSS for this forum Log inLog in 

PHP Forum :: MySQL Forum :: Java Script Forum



PHP, MySQL connection problem

 
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General
View previous topic :: View next topic  
Author Message
ahlandberg



Joined: 23 Nov 2009
Posts: 1

PostPosted: Mon Nov 23, 2009 10:35 pm    Post subject: PHP, MySQL connection problem Reply with quote

Hello experts,

I am encountering a tricky problem during the configuration of my WAMP setup.

Here is what versions I use:

- Win 7
- Apache 2
- PHP 5.2.11
- MySQL 5.1

Apache and PHP work, I also get the mysql and mysqli information tables when I run a <?php phpinfo(); ?> script, so it does look like PHP is picking up the extensions correctly.

In my php.ini, the following mysql extensions are enabled:
extension=php_mysql.dll
extension=php_mysqli.dll

Also, mysql is installed as a service and I can log on to it on the cmd line as follows: mysql -u root -p

However, when I try to run a simple mysql test script as follows, I get no errors, but just a page showing "The connection was reset. The connection to the server was reset while the page was loading."

Code:
<?php
mysql_connect("localhost", "root", "1111") or die(mysql_error());
?>


Then, Firefox turns the URL http://localhost/mysqltest.php into http://www.localhost.com/mysqltest.php in the URL box.

Where to start error analysis? Since there are no PHP erros displayed, I checked the Apache log and find:

[Mon Nov 23 21:27:35 2009] [notice] Server built: Sep 28 2009 22:41:08
[Mon Nov 23 21:27:35 2009] [notice] Parent: Created child process 5188
[Mon Nov 23 21:27:35 2009] [notice] Child 5188: Child process is running
[Mon Nov 23 21:27:35 2009] [notice] Child 5188: Acquired the start mutex.
[Mon Nov 23 21:27:35 2009] [notice] Child 5188: Starting 64 worker threads.
[Mon Nov 23 21:27:35 2009] [notice] Child 5188: Starting thread to listen on port 80.
[Mon Nov 23 21:28:51 2009] [notice] Parent: child process exited with status 255 -- Restarting.
[Mon Nov 23 21:28:51 2009] [notice] Apache/2.2.14 (Win32) PHP/5.2.11 configured -- resuming normal operations
[Mon Nov 23 21:28:51 2009] [notice] Server built: Sep 28 2009 22:41:08
[Mon Nov 23 21:28:51 2009] [notice] Parent: Created child process 5052
[Mon Nov 23 21:28:51 2009] [notice] Child 5052: Child process is running
[Mon Nov 23 21:28:51 2009] [notice] Child 5052: Acquired the start mutex.
[Mon Nov 23 21:28:51 2009] [notice] Child 5052: Starting 64 worker threads.
[Mon Nov 23 21:28:51 2009] [notice] Child 5052: Starting thread to listen on port 80.

It looks like Apache restarts after I request the URL that attempts the mysql connection: Parent: child process exited with status 255 -- Restarting.

Other than that, I couldn't find any logs that can help me further.

Thanks for your help on this issue.

Regards,

Anders[/code]
Back to top
View user's profile Send private message
Seventy



Joined: 25 Nov 2009
Posts: 2

PostPosted: Wed Nov 25, 2009 2:35 am    Post subject: Reply with quote

I thought I would chip in to say that I also have this exact same problem too.

Windows 7 RC1 + WAMP 2.0i.
Same symptoms - Can load normal PHP pages fine, but when using a page that requires any kind of mysql connection, the page just displays "the connection was reset". Even trying to use the inbuilt phpmyadmin causes the same error.
My apache log file is showing the same thing as the post above.

It had been working for weeks fine, but about 2 weeks ago, started to do this. I wondered if it may have been a Windows Auto update that caused it, but I uninstalled a few of the recent ones and that didn't help. I've also tried uninstalling wamp, deleting the wamp folder + data and re-installing to no avail.

I would appreciate any advice.
Thanks.
Back to top
View user's profile Send private message
lostboy



Joined: 02 May 2004
Posts: 5915
Location: toronto, canada

PostPosted: Wed Nov 25, 2009 5:33 am    Post subject: Reply with quote

Just for fun, check the windows firewall. Some updates turn this on and it may block the access to the server.
_________________
Lostboy

Cat, the other other white meat

Please read Posting Etiquette before posting

You can always try Google
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Seventy



Joined: 25 Nov 2009
Posts: 2

PostPosted: Fri Nov 27, 2009 8:19 am    Post subject: Reply with quote

Thanks for the suggestion. I'd tried allowing the various aspects of WAMP exes through the firewall and also turning the firewall off by using the firewall screen and also stopping the firewall service in windows. None of these helped sadly.
Back to top
View user's profile Send private message
Display posts from previous:   
WeberTrivia Questions WeberTrivia Questions
 Think you are smart? Prove it!. Try your skills with these questions :
 WeberTrivia QuestionsRecursive arrays and multi-dimensional arrays are one and the same. (PHP and MySQL)
 WeberTrivia QuestionsThe \"cache_dir\" tag of the squid configuration has a default of /var/spool/squid. (Linux)

WeberTrivia Questions



PHP Code Examples
 Stream diffrent sizes of images from a single image to save disk space.
 JavaScript dropdown list menu to switch any page.
 Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
 PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
 Link Extractor - This function is used to extract links from a given URL. This will convert relative path into absolute path and also remove PHPSESSID stuff.
 Building a Dynamic Form using Javascript and innerHTML. Add form elements in realtime without refreshing the page.
 A PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function.
Post new topic   Reply to topic    WeberForums.com Forum Index -> PHP General All times are GMT + 2 Hours
Page 1 of 1

 
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






Powered by phpBB © 2001, 2005 phpBB Group
PHP Forum :: MySQL Forum :: Java Script Forum