zero-perfoliate
zero-perfoliate

Author Topic: why is it not working...  (Read 2581 times)

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
why is it not working...
« on: December 17, 2008, 11:19:25 AM »
 i am running XAMPP ...only Apache server runs...MYSql doesn't.
i know nothign about setting up a server on my comp can anyone guide me through it...

i was using this script to check that i am doing verything right...it was supposed to display  "Connected to MySQL" but when i open it in OPera it shows

<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL
";
?>

as you can see i have no idea what i a doing..please help me out.I have to submit a portal as my college project by 20th.And i need to connect my registration form data to mysql.

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #1 on: December 17, 2008, 11:26:54 AM »
here's a tutorial on using XAMPP http://www.ibm.com/developerworks/linux/library/l-xampp/

have you put the file in the htdocs folder? when calling it in a browser it also needs to be called via localhost

like http://localhost/filename.php

you should not see php in a browser if it does not work you should see an error message.

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #2 on: December 17, 2008, 11:39:59 AM »
htdocs ??which file?? the php one???

i see the php in a web browser and no error message...
aslo in the status page in
http://localhost/xampp/

MySql is deactivated.. :(

help me ..

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #3 on: December 17, 2008, 11:45:12 AM »
there is an index.php file in the htdocs folder...
i tried to open it with Opera this is waht i got...

Quote
<?php
   if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
      $uri = 'https://';
   } else {
      $uri = 'http://';
   }
   $uri .= $_SERVER['HTTP_HOST'];
   header('Location: '.$uri.'/xampp/');
   exit;
?>
Something is wrong with the XAMPP installation :-(

i have no idea what's going on here....  :'(

it's 2 a.m. here in India and i am so sleepy ..i will come back tomorrow...hope someone here guides me through this...
« Last Edit: December 17, 2008, 11:55:18 AM by eatit007 »

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #4 on: December 17, 2008, 11:59:23 AM »
if you just type in localhost into your browser what do you see?

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #5 on: December 17, 2008, 09:59:33 PM »
when i write local host i see this...


when i click status i see this..


 :-[


Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #6 on: December 18, 2008, 04:02:17 AM »
okay looks like it is installed okay.

Go to your XAMPP folder and find xampp-control double click on it and you should get a control application running in the bottom corner of your screen. Once this is running you can start mysql by clicking on start or tick the box to install mysql as a service.

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #7 on: December 18, 2008, 08:48:31 AM »
when i click on start button  in front of mysql it shows running in green color for 2-3 seconds then disappears.

when i click on start button  in front of Apache server it shows running in green color . and keeps on running...

so mySQL is still not working. :(

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #8 on: December 18, 2008, 09:16:17 AM »
Do you get any error messages in the control window:


Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #9 on: December 18, 2008, 11:38:06 AM »


open image in new tab to see the full image..
i get this now after restarting again the same command prompt error was there..but when i run control it shows the both are running now.And there's a warnign message of directory mismatch.but my Xampp directory is in c:\ !!

now what should i do neXt sir...i wish u were on some messenger. :)
« Last Edit: December 18, 2008, 11:45:01 AM by eatit007 »

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #10 on: December 18, 2008, 11:53:24 AM »
Don't worry about it saying mismatch I have that on mine and all works fine.

Next try running your test file the you mentioned in your first post.

Lets say the file is called test.php and it has been put in xampp/htdocs folder

the file address would be http://localhost/test.php

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #11 on: December 18, 2008, 12:21:06 PM »
it's 2 a.m. here i will get back at ya in the morning.
bear with me please..

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #12 on: December 18, 2008, 12:39:53 PM »
Okay no worries will catch you next time.

Offline eatit007

  • PHP Workers
  • **
  • Posts: 17
  • Karma: +0/-0
Re: why is it not working...
« Reply #13 on: December 18, 2008, 01:51:29 PM »
i tried to open that index.php file in the htdocs folder
and the same error again...

Quote
<?php
   if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
      $uri = 'https://';
   } else {
      $uri = 'http://';
   }
   $uri .= $_SERVER['HTTP_HOST'];
   header('Location: '.$uri.'/xampp/');
   exit;
?>
Something is wrong with the XAMPP installation :-(


and also the old problem is back...when i click on start button  in front of mysql it shows running in green color for 2-3 seconds then disappears.

when i click on start button  in front of Apache server it shows running in green color . and keeps on running...

so mySQL is still not working. :(
i have no idea WTF is going on..

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: why is it not working...
« Reply #14 on: December 18, 2008, 02:12:28 PM »
Just run a google query on similar problems here some links that might help;

http://drupal.org/node/226495
http://www.webdeveloper.com/forum/showthread.php?t=117361

Have you installed mysql standalone in the past? as this could be causing problems.

 

zero-perfoliate