473,748 Members | 7,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My PHP file is unable to connect MYSQL

Rahulnewdelhi
7 New Member
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
12 2895
Rahulnewdelhi
7 New Member
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=mbstr ing.dll and remove semicolon ";" before this dll.

2. Find extension=php_m ysql.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
Rahulnewdelhi
7 New Member
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=mbstr ing.dll and remove semicolon ";" before this dll.

2. Find extension=php_m ysql.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 Recognized Expert Expert
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
483
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. I have a production system, that is running away with no problems. However every so often the command line 'mysql' seems to be unable to connect to the main server running. It complains it can't find the file. Now here is the rub; the file...
1
7957
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
2593
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 'passwd' WITH GRANT OPTION; I can log on locally by specifying the host name:
1
6503
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" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
23
4264
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 PHP . My testing program is as follows : <?php $si = function_exists('mysqli_connect');
1
4134
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 mysql is as follow: $db=mysql_pconnect("hostname",$username,$password); if(!$db){ echo"ERROR:connecting failed"; exit; } else echo"you have connected to database succsessfully"; I want to know what should i write instead of "hostname"...
1
3162
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 Telnet, Remote Desk Connection, SSH. Here are my details ISP: Time Warner Connection Type: Cable Router: Lynksys Port Farwarding: enabled port farwarding to HTTP, Telnet, HTTPS, Remote Desktop Connection, SSH, MySQL etc to my laptop. Connection Type...
8
5303
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"; $mysql_username="hidden";
5
1877
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 installed on that. When i run this (http://localhost/mysql.pl) it just prints out the contents of the file and not an array if the databases... Enlighten me, oh gods of perl #!"C:\xampp\perl\bin\perl.exe"
0
8989
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.