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
  #1  
Old August 17th, 2007, 10:53 AM
ctopkelly ctopkelly is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 4 ctopkelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 37 sec
Reputation Power: 0
Simple Problem??

I have Apache5 Mysql and php5 on a windows xp computer for development.

When i run code like
PHP Code:
<?php
echo ('this is a test');
?>

everthing works fine in the browser, but when i do something like this

PHP Code:
<?php
$connection 
mysql_connect(hostuserpass) or die('ERROR: Unable to connect!');
echo (
' You are connected');
?>

I get nothing in the browser????

I am using Zend Dev sutdio to write code and when i debug the code the HTML displays in the debug screen.

Need to get over this little hump and i will be good to go i think.

thanks

Reply With Quote
  #2  
Old August 17th, 2007, 11:31 AM
cwf's Avatar
cwf cwf is online now
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 343 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 8 m 34 sec
Reputation Power: 2
Check your web server log for errors and/or turn on full php error reporting (both display_errors to on and error_reporting to E_ALL) in php.ini or a .htaccess file.

It is likely that the mysql extension is not enabled and there was a warning. However, your "ERROR: Unable to connect!" should have been produced.

View the source of the page in your browser and see what was output.

Reply With Quote
  #3  
Old August 17th, 2007, 11:35 AM
ctopkelly ctopkelly is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 4 ctopkelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 37 sec
Reputation Power: 0
Quote:
Originally Posted by cwf
Check your web server log for errors and/or turn on full php error reporting (both display_errors to on and error_reporting to E_ALL) in php.ini or a .htaccess file.

It is likely that the mysql extension is not enabled and there was a warning. However, your "ERROR: Unable to connect!" should have been produced.

View the source of the page in your browser and see what was output.

here is the source from IE
Code:
<html>
<head>
<title>
This is a test!!!!
</title>
</head>
<body>

Reply With Quote
  #4  
Old August 17th, 2007, 12:00 PM
cwf's Avatar
cwf cwf is online now
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 343 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 8 m 34 sec
Reputation Power: 2
Neither piece of php code that you posted could produce the output you just showed. Double check what you are actually doing and what code you are using at the time.

Reply With Quote
  #5  
Old August 17th, 2007, 12:06 PM
ctopkelly ctopkelly is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 4 ctopkelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 37 sec
Reputation Power: 0
well what about this code?

PHP Code:
<html>
<
head>
</
head>
<
body>
<?
php 
$connection 
mysql_connect(hostuserpass) or die('ERROR: Unable to connect!'); 
echo (
' You are connected'); 
?>

</body>
</html> 

should it not print out "You are connected" if i get connected or "Error: Unable to connect!" after it runs?

Reply With Quote
  #6  
Old August 17th, 2007, 01:02 PM
ctopkelly ctopkelly is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 4 ctopkelly User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 37 sec
Reputation Power: 0
Fixed it!!!!!!!!!!!!

Quote:
Originally Posted by ctopkelly
well what about this code?

PHP Code:
<html>
<
head>
</
head>
<
body>
<?
php 
$connection 
mysql_connect(hostuserpass) or die('ERROR: Unable to connect!'); 
echo (
' You are connected'); 
?>

</body>
</html> 

should it not print out "You are connected" if i get connected or "Error: Unable to connect!" after it runs?


Ok i fixed it, and this is what my problem was

well it looks like the windows install of PHP does not come with a few ext you need to run with mysql.

so first thing i had to do was go to this site and download the ext dll's
("us.php.net/get/php-5.2.3-Win32.zip/from/a/mirror")
unziped it to the ext folder under the php folder.
( you may have to make this folder if it is not there)

next thing i did was change the php.ini file to
extension_dir = C:\Program Files\Apache Software Foundation\Apache2.2\PHP\ext
( right around line 220)

finaly i uncommented
extension=php_mysql.dll
extension=php_mysqli.dll
(around line 660)

rebooted the the server and BAMMMMM!!!
working.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Installation > Simple 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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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