localhost - can't connect - but MySql DB connects?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

localhost - can't connect - but MySql DB connects?

Postby snacks » 19. December 2012 18:05

Hello all - I am new to all things programming and DB but I have been learning and using XAMPP (1.8.1 on Win7) for a few months and have been having no problems for the most part. I have no issues connecting to XAMPP or PHPMyAdmin or interacting with my databases, even through php scripts on an HTML page. The issue I have been having is on the simple "http://localhost" page.

When first installed, the "localhost" page would show the "It Works!" message with no issues. I stopped loading this page and went straight to "localhost/xampp" most days. When I recently went to "localhost" it gave me the 'Parse error: syntax error, unexpected '$link' (T_VARIABLE) in C:\xampp\htdocs\controller.php on line 6' error which I researched and fixed by adding a ';' to line 5. Now when I load "localhost" I get the 'Could not connect to the database.' error message. I have tried to change the username and password in the 'controller.php' file but still get the same message. On the PHPMyAdmin page, the 'CD collection' example included also returns 'Could not connect to the database!'.

While I am having no other problems, I am about to build a site that will need to access the database. I'm afraid that this simple issue may become a bigger headache somewhere down the line. I've tried changing passwords, trying solutions found online, and everything else I could think of to no avail. About the only thing left that I can come up with is to reinstall and start from scratch but I'm sure the real solution is very simple.

If anyone has any ideas or suggestions, they will be greatly appreciated!
snacks
 
Posts: 2
Joined: 19. December 2012 17:43
XAMPP Version: 5.6.3
Operating System: Win7

Re: localhost - can't connect - but MySql DB connects?

Postby JonB » 20. December 2012 11:57

even through php scripts on an HTML page.

When first installed, the "localhost" page would show the "It Works!" message with no issues.


Both of these mean your install was never correctly working.

I would suggest you post the tail of your Apache error log. My guess is you have a .dll extension that is bombing the php parser.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: localhost - can't connect - but MySql DB connects?

Postby snacks » 20. December 2012 16:33

Thank you Jon for having a look.

I was able to sort out the 'CD Collection' issue by opening the cds.php file and inserting my password. Not real clear on why that was needed there and never discussed during the basic intros I was watching after install.

Below is my Apache error log for this morning. I tried to route to 'localhost' this morn a couple times at different points so that it would hopefully show. Please let me know if you need to see more.



[Thu Dec 20 10:21:01.517749 2012] [core:warn] [pid 7916:tid 248] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Dec 20 10:21:01.949773 2012] [ssl:warn] [pid 7916:tid 248] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 20 10:21:02.186787 2012] [mpm_winnt:notice] [pid 7916:tid 248] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Thu Dec 20 10:21:02.186787 2012] [mpm_winnt:notice] [pid 7916:tid 248] AH00456: Server built: Aug 18 2012 12:41:37
[Thu Dec 20 10:21:02.186787 2012] [core:notice] [pid 7916:tid 248] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Dec 20 10:21:02.191787 2012] [mpm_winnt:notice] [pid 7916:tid 248] AH00418: Parent: Created child process 10308
[Thu Dec 20 10:21:03.663871 2012] [ssl:warn] [pid 10308:tid 260] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 20 10:21:03.727875 2012] [mpm_winnt:notice] [pid 10308:tid 260] AH00354: Child: Starting 150 worker threads.
[Thu Dec 20 10:25:09.594938 2012] [core:warn] [pid 9276:tid 248] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Dec 20 10:25:09.973959 2012] [ssl:warn] [pid 9276:tid 248] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 20 10:25:10.045964 2012] [mpm_winnt:notice] [pid 9276:tid 248] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Thu Dec 20 10:25:10.045964 2012] [mpm_winnt:notice] [pid 9276:tid 248] AH00456: Server built: Aug 18 2012 12:41:37
[Thu Dec 20 10:25:10.045964 2012] [core:notice] [pid 9276:tid 248] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Dec 20 10:25:10.049964 2012] [mpm_winnt:notice] [pid 9276:tid 248] AH00418: Parent: Created child process 9788
[Thu Dec 20 10:25:11.537049 2012] [ssl:warn] [pid 9788:tid 260] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 20 10:25:11.611053 2012] [mpm_winnt:notice] [pid 9788:tid 260] AH00354: Child: Starting 150 worker threads.
snacks
 
Posts: 2
Joined: 19. December 2012 17:43
XAMPP Version: 5.6.3
Operating System: Win7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 47 guests