9 Replies - 2579 Views - Last Post: 14 June 2010 - 11:26 AM

#1 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

php and mysql config, URGENT

Posted 14 June 2010 - 07:53 AM

hey guys,
i have installed apache and php and configured it to work

now i installed mysql and did everything, had an error but found a tutorial and solved it.

now my issue is, how to configure php with mysql..

i tried all the solution i found like adding dll to php directory,
enable dll's in php.ini, but none work..

my mysql server starts, but while making any connection, or even logging in into phpmyadmin, it stucks,,

nothing happens,.

can u please help me?

Is This A Good Question/Topic? 0
  • +

Replies To: php and mysql config, URGENT

#2 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:21 AM

You mention dll's, yet in your other topic you were talking about Ubuntu.

Can you please provide the details of your setup?
Was This Post Helpful? 0
  • +
  • -

#3 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:32 AM

actually, i wasnt talking about ubuntu, some one over there was, over there too i mentioned then i am on windows..
anyways,
i am on windows 7 x64, mysql latest, 5.1.4. install php 5.3.2, and apache 2.2.14.

i installed apache, and php on normal settings, and enabled apache php, it is working..

then i installed mysql, ran the create instance wizard, finished all. and then i tried to run phpmyadmin..

script hangs (white blank screen) after loggin in.

and i tried a manual script like mysql_connect("localhost", "root", "******") or die(mysql_error());
still the blank white screen..

hope u can help me:)
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6078
  • View blog
  • Posts: 23,550
  • Joined: 23-August 08

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:34 AM

Blank screen probably means you have a syntax error in your PHP.
Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:35 AM

MySql runs from the system, & should be independent of PHP & Apache.
Was This Post Helpful? 0
  • +
  • -

#6 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:38 AM

even for phpmyadmin?
and i have also tried the script on xampp it worked..

anyways, here
<?php
mysql_connect("localhost","root","")
 or die("sorry - unable to connect to MySQL");
 echo("Congrats - it's working");
?>


and one more
<?php
		$connect = mysql_connect("localhost", "root", "******");
		if(!$connect)
		{
			die("Invalid settings, please check".mysql_error());
		}
?>


second script is from my project i am working on..

i agree on independent stuff,
coz it doesnt need to be compiled or anything like that,
plus the dll's are by-default enabled in php.ini for 5.2.3

so this is a really wierd what i am facing.
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5364
  • View blog
  • Posts: 27,325
  • Joined: 10-May 07

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:38 AM

You can also verify that it's reading the script with some standard output :

<?php
echo "<p>Starting SQL<hr></p>";
mysql_connect("localhost","root","")
 or die("sorry - unable to connect to MySQL");
 echo("Congrats - it's working");
?>


Can you also verify that the mysql service is running on your Windows server?
Was This Post Helpful? 0
  • +
  • -

#8 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

Re: php and mysql config, URGENT

Posted 14 June 2010 - 08:44 AM

okay, i turned off mysql server manually and tried everything again, i am getting the same white screen.
so my guess is now, php is not able to communicate with mysql..

is there any advance setting in php.ini?

this are my php.ini settings
[MySQL]
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; http://php.net/mysql.allow_local_infile
mysql.allow_local_infile = On

; Allow or prevent persistent links.
; http://php.net/mysql.allow-persistent
mysql.allow_persistent = On

; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/mysql.cache_size
mysql.cache_size = 2000

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/mysql.max-persistent
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
; http://php.net/mysql.max-links
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysql.default-port
mysql.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysql.default-socket
mysql.default_socket = "MySQL"

; Default host for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-host
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-user
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysql.default-password
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
; http://php.net/mysql.connect-timeout
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
; http://php.net/mysql.trace-mode
mysql.trace_mode = Off



yes, the service is working. and its started :)

i ran ur script,
i got starting sql and a hr, but nothing else

This post has been edited by smartflower2002: 14 June 2010 - 08:40 AM

Was This Post Helpful? 0
  • +
  • -

#9 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

Re: php and mysql config, URGENT

Posted 14 June 2010 - 09:01 AM

okay this is what i did,
i ran apache and php from XAMPP
and i ran mysql from what i installled now..

it is working like charm..

so my best best guess now is the php i installed cannot communicate with mysql i installed..
Was This Post Helpful? 0
  • +
  • -

#10 smartflower2002  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 116
  • Joined: 20-May 10

Re: php and mysql config, URGENT

Posted 14 June 2010 - 11:26 AM

any one?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1