PHP Installation
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Installation

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 20th, 2005, 04:33 PM
leavehere leavehere is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 55 leavehere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
PHP connect to MYSQL problem

Hello,

Hi,

Windows XP Pro SP2
Apache 2.0.53
PHP 5.0.3
MySQL 4.1.10a

I just installed all above and the PHP runs on Apache successfully. However after I installed the MySql, and tired to use the following PHP code to test it, I failed:
=======
<?php
mysql_connect("localhost", "root", "root") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
=======

root is both my username and pwd.

When I run the PHP page, nothing displayed on the page but a blank page. Actually I ve used certain diff. PHP code to test the MySQL connection, the result is same: An BLANK PAGE.

===============================
1.after that I checked the PHP Manual, it says the PHP5 doesnt support mysql as what PHP4 does. But I dont know how to exactly configure the PHP5 to support mysql?

2.somebody told me that the reason of the blank page is that the error_reporting is turned off in my php.ini(php.ini-recommended) which is copied into C:/windows/. But in the file:

error_reporting = E_ALL

does it mean the error_reporting is on?

3. I also tried to use php.ini-dist instead of the recommeded, it sets:

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

however, when I try to run the code below:

<?php
asdfasdd
?>

still a blank page displayed.

=======
I think there are problems with my PHP/MySql settings, but I cnanot figure them out. any helps?

Thanks a lot!!!

Reply With Quote
  #2  
Old March 21st, 2005, 01:19 PM
Ashkhan Ashkhan is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 372 Ashkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 57 sec
Reputation Power: 2
RE: PHP connect to MYSQL problem

You should try to test your mysql server from shell first.

Reply With Quote
  #3  
Old March 21st, 2005, 08:36 PM
leavehere leavehere is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 55 leavehere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: PHP connect to MYSQL problem

yes, i ve tested. the mysql server works well itself, but got problem with php.

Reply With Quote
  #4  
Old March 21st, 2005, 09:20 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: PHP connect to MYSQL problem

Please do not post the same thread in multiple places.

Thank you
Andrew

Reply With Quote
  #5  
Old March 22nd, 2005, 09:07 AM
Ashkhan Ashkhan is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 372 Ashkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 57 sec
Reputation Power: 2
RE: PHP connect to MYSQL problem

I hope it's alright to reply to this thread.

Anyway, try this:

php Code:
Original - php Code
  1.  
  2. <?php
  3. mysql_connect("127.0.0.1", "root", "root") or die(mysql_error());


Assuming your Apache and php are configured in the right way.

If I remember correctly it was necessary to enable mysql support in php.ini

Reply With Quote
  #6  
Old March 22nd, 2005, 09:09 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: PHP connect to MYSQL problem

guys, thanks for help. and i ve solved the problem by re-configuing everything.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > PHP connect to MYSQL problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway