<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
tail -f /var/log/apache/access.log or error.log will help diagnose php
and file issues (precise log names differ according to distro)<br>
<br>
For troubleshooting mysql purposes I normally use the root mysql user
credentials for php auth instead of "mick".<br>
<br>
Also phpmyadmin is usually an easy install, allowing you to get a gui
view of your mysql db's, permissions etc.<br>
<br>
On 23/07/12 11:42, Michael E. Rentell wrote:
<blockquote cite="mid:500D2A80.7010809@ntlworld.com" type="cite">Good
morning all,
  <br>
As a part of my plan to limit the atrophying of my ageing brain I am
working through 'PHP &amp; MySQL for Dummies'. I think I have got
apache installed OK because when I point firefox at localhost I get the
'It's working' response. So I then composed the following script,
called it test.php and stored it in /var/www:
  <br>
  <br>
-----------------------------
  <br>
  <br>
&lt;html&gt;
  <br>
&lt;head&gt;
  <br>
&lt;title&gt;PHP Test&lt;/title&gt;
  <br>
&lt;/head&gt;
  <br>
&lt;body&gt;
  <br>
&lt;p&gt;This is an HTML line
  <br>
&lt;p&gt;
  <br>
&lt;?php
  <br>
&nbsp; echo "This is a PHP line";
  <br>
&nbsp; phpinfo();
  <br>
?&gt;
  <br>
&lt;/body&gt;&lt;/html&gt;
  <br>
  <br>
----------------------------
  <br>
  <br>
When I point firefox at it I get a huge table of dozens of properties
which baffle me. But it seems to indicate that php is also working.
  <br>
  <br>
The next step in the book is to generate a mysql db so from the CLI I
went through generating mydb, user mick and a simple password. However,
there is no data in this DB.
  <br>
  <br>
Then to test that I composed the following script, called it test2.php
and added it to /var/www:
  <br>
  <br>
--------------------------
  <br>
  <br>
&lt;?php
  <br>
  <br>
$host = "localhost";
  <br>
$user = "mick";
  <br>
$pass = "simplepassword";
  <br>
  <br>
$r = mysql_connect($host, $user, $pass);
  <br>
  <br>
if (!$r) {
  <br>
&nbsp;&nbsp;&nbsp; echo "Could not connect to server\n";
  <br>
&nbsp;&nbsp;&nbsp; trigger_error(mysql_error(), E_USER_ERROR);
  <br>
} else {
  <br>
&nbsp;&nbsp;&nbsp; echo "Connection established\n";
  <br>
}
  <br>
  <br>
echo mysql_get_server_info() . "\n";
  <br>
  <br>
mysql_close();
  <br>
  <br>
?&gt;
  <br>
  <br>
----------------------------
  <br>
  <br>
When I point firefox at localhost/test2 I get a completely clear
screen. It neither seems to work or return the error. It is supposed to
return a different table of parameters etc.
  <br>
  <br>
Am I doing something stupid here/ If anyone can help an aged beginner I
would be most grateful. I've been banging my head against this for
several days and the book isn't any help as it expects the text to
'just work' and it don't.
  <br>
  <br>
MikeR
  <br>
in Folkestone
  <br>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Kent mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a>
<a class="moz-txt-link-freetext" href="https://mailman.lug.org.uk/mailman/listinfo/kent">https://mailman.lug.org.uk/mailman/listinfo/kent</a></pre>
</blockquote>
</body>
</html>