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_apress, $apress);
$query_rstCDS = "SELECT cd_name FROM cd";
$rstCDS = mysql_query($query_rstCDS, $apress) or die(mysql_error());
$row_rstCDS = mysql_fetch_assoc($rstCDS);
$totalRows_rstCDS = mysql_num_rows($rstCDS);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<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_rstCDS ?> Records in our colleciton</p>
<p>&nbsp;</p>
</body>
</html>
<?php
mysql_free_result($rstCDS);
?>




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

Don't blame me. I voted for Gore.
.



Relevant Pages

  • Re Re: PHP 5.2.4 <= various mysql functions safemode & open_basedir bypass
    ... > various mysql functions safemode & open_basedir bypass ... PHP is currently very used because it's easy to use. ... Apache has directory restrictions. ... # if the mysql user has perms, ...
    (Bugtraq)
  • Re: looking for "How-to" book for SECURELY setting up apache/PHP/MySQL
    ... Dunno about a book, I do know I was much helped by the Securityfocus' primers on setting up Apache, Mysql and PHP securely. ... Before buying any computer related book these days I first have a peek at a downloaded ebook copy before I decide to buy. ...
    (comp.os.linux.misc)
  • Re: Learning PHP and MYSQL on own laptop possible?
    ... likely put it on a more powerful machine and learn Linux and Apache. ... BTW - many books on PHP and MYSQL include a section on how to install ...
    (comp.lang.php)
  • Re: Apache and Tux running together
    ... my job we've got a web based product provided by Apache running PHP ... This web application is hosted by multiple servers ... and MySQL totalling 15 Megs of ram), ...
    (comp.lang.php)
  • Re: I am totally stumped..with this on..LOAD_FILE Mysql+PHP= FSCK!!
    ... What I am trying to do is to upload files and stuff them in a mysql database. ... I copied the temporary file to somewhere else, and then handed it to MySQL..THAT WORKED.. ... Is there a way to force a close on the file..maybe that's the problem Mysql is opening a file that is not flushed to disk maybe? ... I gew the feeling its maintaining its own picture of file objects, and doesn't actually flush to the disk unless you do a copy or close php.. ...
    (comp.lang.php)