[Klug-general] LAMP start up problem

Karl Buckland buckland.karl at gmail.com
Mon Jul 23 11:31:47 UTC 2012


If you installed PHP from packages, then you probably only installed
the core and not some of the modules you might need.

Often MySQL is in its own module. On Debian/Ubuntu you would usually
need to install the php5-mysql package.

Karl B


On 23 July 2012 12:25, Michael E. Rentell <michael.rentell at ntlworld.com> wrote:
> Thanks for the advice. The error log reports that 'mysql_connect' is not
> recognised as a valid php instruction. I've noticed that everywhere it is
> installed apache is called apache2. Could that be a problem? Deeply into
> ignorance here.
> MikeR
>
>
> On 23/07/12 12:07, Alan Buchel wrote:
>
> tail -f /var/log/apache/access.log or error.log will help diagnose php and
> file issues (precise log names differ according to distro)
>
> For troubleshooting mysql purposes I normally use the root mysql user
> credentials for php auth instead of "mick".
>
> Also phpmyadmin is usually an easy install, allowing you to get a gui view
> of your mysql db's, permissions etc.
>
> On 23/07/12 11:42, Michael E. Rentell wrote:
>
> Good morning all,
> As a part of my plan to limit the atrophying of my ageing brain I am working
> through 'PHP & 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:
>
> -----------------------------
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <p>This is an HTML line
> <p>
> <?php
>   echo "This is a PHP line";
>   phpinfo();
> ?>
> </body></html>
>
> ----------------------------
>
> 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.
>
> 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.
>
> Then to test that I composed the following script, called it test2.php and
> added it to /var/www:
>
> --------------------------
>
> <?php
>
> $host = "localhost";
> $user = "mick";
> $pass = "simplepassword";
>
> $r = mysql_connect($host, $user, $pass);
>
> if (!$r) {
>     echo "Could not connect to server\n";
>     trigger_error(mysql_error(), E_USER_ERROR);
> } else {
>     echo "Connection established\n";
> }
>
> echo mysql_get_server_info() . "\n";
>
> mysql_close();
>
> ?>
>
> ----------------------------
>
> 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.
>
> 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.
>
> MikeR
> in Folkestone
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent
>
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent



More information about the Kent mailing list