473,756 Members | 8,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hlep with w2k LAMP configuration, I think.


Is there a usenet group for Apache questions? If I knew of one I'd
post the question there.

I can't get a MySQL connection in PHP code under apache to work.

I'm learning LAMP, starting on a w2k box. I've downloaded recent
copies of Apache, MySQL and PHP and done the setup and it seems to
work,except for SQL. I can run pure PHP under the apache server and
I've installed phpmyadmin and I can make a database and then access it
from mysql in a cmd shell.

I suspect there is some configuration in Apache to talk to Mysql that
I've missed. There is no explicit mention of MySQL in my httpd.conf.

This code is my index.php file, generated from Dreamweaver8. When I
put it on my server and try to hit it from my browser (Firefox) it
just hangs and times out. Any other file (like index.htlm) works
fine, and a ling on index.html to index.php also hangs. All the
passwords, etc, work when tested from command line mysql.

I watch the Apache transaction log and see the client server activity.
There is none when I type to execute this code.

/Connections/apress.php is where it's supposed to be and the contents look fine.
It was generated by DW.

Thanks.

---index.php---

<?php virtual('/index.php/Connections/apress.php'); ?>
<?php
mysql_select_db ($database_apre ss, $apress);
$query_rstCDS = "SELECT cd_name FROM cd";
$rstCDS = mysql_query($qu ery_rstCDS, $apress) or die(mysql_error ());
$row_rstCDS = mysql_fetch_ass oc($rstCDS);
$totalRows_rstC DS = mysql_num_rows( $rstCDS);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>My CD collection</title>
</head>

<body>
<p>&nbsp;</p>
<p>My CD COllection</p>
<p>&nbsp;</p>
<p><?php echo $totalRows_rstC DS ?> Records in our colleciton</p>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_resu lt($rstCDS);
?>


--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.
Mar 7 '06 #1
3 1730
Following on from Al Dykes's message. . .


I suspect there is some configuration in Apache to talk to Mysql that
I've missed. There is no explicit mention of MySQL in my httpd.conf.


(1) Apache needs to know about php
(2) PHP needs to know about MySQL
From this analysis you can see that it is the php.ini file where you
should be looking. Version 5 needs MySQL enabling whereas version 4 was
enabled by default. (I can't give the details at the moment - look in
the V5 docs)

--
PETER FOX Not the same since the e-commerce business came to a .
pe******@eminen t.demon.co.uk.n ot.this.bit.no. html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.dem on.co.uk>
Mar 8 '06 #2
Al Dykes wrote:
Is there a usenet group for Apache questions? If I knew of one I'd
post the question there.

How about alt.apache.conf iguration?
I can't get a MySQL connection in PHP code under apache to work.

Not good. :-)
I'm learning LAMP, starting on a w2k box. I've downloaded recent
copies of Apache, MySQL and PHP and done the setup and it seems to
work,except for SQL. I can run pure PHP under the apache server and
I've installed phpmyadmin and I can make a database and then access it
from mysql in a cmd shell.

Then MySQL and PHP ARE working together.
I suspect there is some configuration in Apache to talk to Mysql that
I've missed. There is no explicit mention of MySQL in my httpd.conf.

You shouldn't need it in the httpd.conf file. Apache isn't accessing
MySQL - PHP is. But it does need to be in your php.ini file.
This code is my index.php file, generated from Dreamweaver8. When I
put it on my server and try to hit it from my browser (Firefox) it
just hangs and times out. Any other file (like index.htlm) works
fine, and a ling on index.html to index.php also hangs. All the
passwords, etc, work when tested from command line mysql.

Hmmm, that doesn't sound good :-) I watch the Apache transaction log and see the client server activity.
There is none when I type to execute this code.

What about the Apache error log? And your MySQL log? Anything there?

Also - did you actually connect to the host in your include file? Since
you didn't post it, we don't know.

If you can't find any errors, you may have to back up and do some
troubleshooting . Like comment out all the MySQL code except the call to
connect and try. If it works, add the db selection, and so on.
/Connections/apress.php is where it's supposed to be and the contents look fine.
It was generated by DW.

I never trust generated code. I use it, but not without examining it
very closely first. I've been burned too many times. Congratulations
for checking it!
Thanks.


<code snipped>
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 8 '06 #3
In article <dY************ ********@comcas t.com>,
Jerry Stuckle <js*******@attg lobal.net> wrote:
Al Dykes wrote:
Is there a usenet group for Apache questions? If I knew of one I'd
post the question there.


How about alt.apache.conf iguration?
I can't get a MySQL connection in PHP code under apache to work.


Not good. :-)
I'm learning LAMP, starting on a w2k box. I've downloaded recent
copies of Apache, MySQL and PHP and done the setup and it seems to
work,except for SQL. I can run pure PHP under the apache server and
I've installed phpmyadmin and I can make a database and then access it
from mysql in a cmd shell.


Then MySQL and PHP ARE working together.
I suspect there is some configuration in Apache to talk to Mysql that
I've missed. There is no explicit mention of MySQL in my httpd.conf.


You shouldn't need it in the httpd.conf file. Apache isn't accessing
MySQL - PHP is. But it does need to be in your php.ini file.

Thanks for you comments. I've gutted the Dreamweaver code and reduced
the problem to textbook code;
<?php
@mysql_connect( "localhost" , "book2", "book2")
or die("Could not connect to MySQL server!");

@mysql_select_d b("book2")
or die("Could not select database!");
?>

It works and I'm on to other problems. I'll deal with DW later. I'll
deal with dreamweaver later.
--
a d y k e s @ p a n i x . c o m

Don't blame me. I voted for Gore.
Mar 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2215
by: Ranger West | last post by:
Hello there, Are there any out-of-the box handhelds that run Linux/Apache/MYSQL and PHP? Does Redhat, Suse, or Gentoo support any handhelds? I know the Zaurus comes close, but I've heard people have problems running LAMP applications on it. It would be cool to be able to run any LAMP application on sourceforge on a handheld computer.
12
2813
by: Google Mike | last post by:
You know, while working on my moonlight corporation's LAMP project at home this weekend, I couldn't help but wonder if people writing similar projects are solving similar problems with having to complete the project by building an installer and building the user/group administration piece of it. The thought came to me that it would be great if LAMP developers, whether they used MySQL or PostgreSQL, could just simply write the project to...
10
23602
by: Zabby | last post by:
hi, i want to turn on/turn off a usb lamp via a vb.net button... i think i would have to turn on/turn off the power for this usb port.... how could i do this? kind regards
2
6909
by: Yogee | last post by:
Hello all, I dont know the exact group where I should post my questions. So, I m doing it on most of the groups which support components of LAMP stack. My client wants to use WAMP ( Windows + apache + MySQL + PHP ). But the site performance is very slow on windows. I dont know the exact reasons. I have seen some benchmark details on internet. But still they are not
21
2044
by: joelbyrd | last post by:
I was looking at jobs on craigslist and saw several postings saying something like "2+ years experience developing for a LAMP (Linux/Apache/MySQL/PHP) platform...". Now, I've been working with PHP and MySQL a few months now, but here's my question: where does the Linux part and Apache part come in? What should I know? In other words, I don't think I've ever had to deal with anything specific to Linux or Apache, so in what circumstances...
0
1037
by: Sam | last post by:
Folks, I am new to ASP.Net 2.0. I do not know what I did with my configuration settings... Now when I drag and drop Sqldatasource from the toolbox, I can't see it in the design view. Even it disappeared from my existing forms... However when I swtched to source view, that referrence to Sqldatasource
1
1592
by: flash | last post by:
Need hlep to delete array only because all function is ok (inser, sort andsearch) #include <iostream.h> //functions prototype void Insert(int,int); void Delete(int,int); int Search(int,int); void Sort(int,int);
39
2584
by: Gilles Ganault | last post by:
Hello, I'm no LAMP expert, and a friend of mine is running a site which is a bit overloaded. Before upgrading, he'd like to make sure there's no easy way to improve efficiency. A couple of things: - MySQL : as much as possible, he keeps query results in RAM, but apparently, each is session-specific, which means that results can't be shared with other users.
0
9303
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
9117
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,...
1
9676
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
9541
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...
1
7078
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
5156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3651
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3141
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2508
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.