473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

My PHP file is unable to connect MYSQL

Rahulnewdelhi
hello all

Hello all

I installed php, mysql and IIS in xp. Problem is this while i run following file

PHP Code:
----------------

<?php
phpinfo();
?>

it doesnt show mysql info table in result. I seen mysql server it is running well. While i am trying to connect

my php file to mysql database then it doesnt connect. why it is happening? how to short out this problem,

please help me

regards
May 4 '07 #1
12 2853
i will want you to send me your mail adress anmd i will send ou the mailer on
here is my mail adress(jamescott_2@hotmail.com)...



Hello all

I installed php, mysql and IIS in xp. Problem is this while i run following file

PHP Code:
----------------

<?php
phpinfo();
?>

it doesnt show mysql info table in result. I seen mysql server it is running well. While i am trying to connect

my php file to mysql database then it doesnt connect. why it is happening? how to short out this problem,

please help me

regards[/quote]
May 4 '07 #2
teesha
4
i think you need to verify dynamic extensions in "php.ini " (your configuration file)
extension=php_mysql.dll
extension=php_mysqli.dll
don't forget to restart your server
May 4 '07 #3
pbmods
5,821 Expert 4TB
Did you install PHP after you installed MySQL? DId you install PHP with MySQL support? It's been awhile since I've worked on a PC, but when you're using the PHP installer, it should give you the option to install optional components. Verify that MySQL is selected in that list.
May 5 '07 #4
Hello all

I installed php, mysql and IIS in xp. Problem is this while i run following file

PHP Code:
----------------

<?php
phpinfo();
?>

it doesnt show mysql info table in result. I seen mysql server it is running well. While i am trying to connect my php file to mysql database then it doesnt connect. why it is happening? how to short out this problem,

please help me
May 8 '07 #5
ak1dnar
1,584 Expert 1GB
[PHP]<?php
if (function_exists('mysql_connect')) {
echo "function available.<br />\n";
} else {
echo "function not available.<br />\n";
}
?> [/PHP]

what is the output that you can get in your end for this script.
May 8 '07 #6
Motoma
3,237 Expert 2GB
You may still need to configure PHP to work with MySQL. PHP.net is a great resource for such information.
May 9 '07 #7
This function is not working and showing result "function not available".



[PHP]<?php
if (function_exists('mysql_connect')) {
echo "function available.<br />\n";
} else {
echo "function not available.<br />\n";
}
?> [/PHP]

what is the output that you can get in your end for this script.
May 10 '07 #8
ak1dnar
1,584 Expert 1GB
This probably the configuration on your PHP.ini read this article.
Installation on Windows Systems
May 10 '07 #9
ufitzi
3
This post may have something to do with your problem.
http://www.thescripts.com/forum/thread429124.html

I'm currently in the same boat as you, both PHP and MYSQL are running, but PHP doesn't seem to be finding the php.ini file, which in turn results in the /ext/ directory (where the php_mysql.dll is located) not being read correctly.

If you run the phpinfo() function, you will see a summary of all php environment.
My guess is you will find the values you've entered in your php.ini file are NOT the ones being used. The post above seems to indicate a solution, however he was not very specific in the steps taken to resolve this issue. I would like to contact him to determine those steps, but he posted as a guest user. Hopefully someone else has info on the permissions solution he described.Good luck, I will post back here once I've figured this out.
bh
May 25 '07 #10
hey friend finally i found the solution of this problem. i tell you

after installation of php and mysql check both r working or not.

1. open you php.ini file and find extension=mbstring.dll and remove semicolon ";" before this dll.

2. Find extension=php_mysql.dll and again remove semicolon ";" before this dll

3. Find extension_dir="./" and replace it with extension_dir=c:\php\ext

then save and exit from your php.ini file

4. right click on your mycomputer icon and click properties

(o) Select advance tab

(o) Click on environment variable

(o) Click on new button from system variable area

(o) put PHPRC as variable name and C:\php as variable value and then click several ok

(o) Restart you web server and run php file contained phpinfo(); function and you will see mysql configration table











This post may have something to do with your problem.
http://www.thescripts.com/forum/thread429124.html

I'm currently in the same boat as you, both PHP and MYSQL are running, but PHP doesn't seem to be finding the php.ini file, which in turn results in the /ext/ directory (where the php_mysql.dll is located) not being read correctly.

If you run the phpinfo() function, you will see a summary of all php environment.
My guess is you will find the values you've entered in your php.ini file are NOT the ones being used. The post above seems to indicate a solution, however he was not very specific in the steps taken to resolve this issue. I would like to contact him to determine those steps, but he posted as a guest user. Hopefully someone else has info on the permissions solution he described.Good luck, I will post back here once I've figured this out.
bh
Jun 1 '07 #11
hey friend finally i found the solution of this problem. i tell you

after installation of php and mysql check both r working or not.

1. open you php.ini file and find extension=mbstring.dll and remove semicolon ";" before this dll.

2. Find extension=php_mysql.dll and again remove semicolon ";" before this dll

3. Find extension_dir="./" and replace it with extension_dir=c:\php\ext

then save and exit from your php.ini file

4. right click on your mycomputer icon and click properties

(o) Select advance tab

(o) Click on environment variable

(o) Click on new button from system variable area

(o) put PHPRC as variable name and C:\php as variable value and then click several ok

(o) Restart you web server and run php file contained phpinfo(); function and you will see mysql configration table





hello all

Hello all

I installed php, mysql and IIS in xp. Problem is this while i run following file

PHP Code:
----------------

<?php
phpinfo();
?>

it doesnt show mysql info table in result. I seen mysql server it is running well. While i am trying to connect

my php file to mysql database then it doesnt connect. why it is happening? how to short out this problem,

please help me

regards
Jun 1 '07 #12
pbmods
5,821 Expert 4TB
Merged duplicate threads.

Changed thread title to remove annoying 'help me'.
Jun 3 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Alan Williamson | last post by:
looking through all the forums and newsgroups it would appear that mysql.sock is definitely one for the Top10 of all time problems. However, i have yet to see an answer that properly addresses it....
1
by: Sridhar Reddy | last post by:
Hi, Where can i get the download mysql.sock file? I am unable to connect to local server because i dont have this file? thanx in advance Sridhar
3
by: pc | last post by:
hi everyone, I am trying to connect to a new mysql installation. I have given root permission to connect to all databases from anywhere; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
23
cyberking
by: cyberking | last post by:
Hi. I have just started learning PHP along with MySQL. I am trying to connect to the MySQL DB server but unable to. I have been tryin. Please help. Its urgent cos I shall soon have to work on...
1
by: iceboy | last post by:
Hello to all,I have a problem to connect PHP & MySQL together. I have created a form that gets the username & password from admin and connect him to database.the part of PHP script that connect to...
1
by: ynyus75 | last post by:
Hey! I am unable to connect some of the services that I host from my laptop at home, such as SMTP and MySQL on port numbers 25 and 3306 respectively. But I am able to some services such as...
8
by: malaysiauser | last post by:
Im new user of PHP and MySQL. I tried to use a script package for my web. I'd created a database. And my connection scripts are as follow; <?php $mysql_host="localhost"; ...
5
Markus
by: Markus | last post by:
I'll leave out the annoying 'i'm a newbie' speech and get to the point: i'm a newbie at perl ;) First thing i ever wrote in perl and it doesnt work. I'm using xampp as my localhost - with perl...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.