[Klug-general] LAMP start up problem

Alan Buchel alan at communitytechnology.org.uk
Mon Jul 23 11:32:50 UTC 2012


/var/log/apache2 would be on a modern Debian/Ubuntu box, /var/log/httd/
on a centos/RHEL/Fedora box. So yes, Apache2 is correct.

For mysql_connect I normally use an auth file in this format and it
works so try that instead?

============================

<?php
$sqlcon = true;
//Connect to database
if(include('creds.php')){
        if($dbc = @mysql_connect('localhost', $sqluser, $sqlpass)){
                if(!@mysql_select_db('collections')){
                        die('<p>Could not select the database because:
<b>' . mysql_error() . '</b></p>');
                }
        }else{
                die('<p>Could not connect to MySQL because: <b>' .
mysql_error() . '</b></p>');
        }
}else{
        print "Could not load credentials file.";
}
?>

========================
creds.php:

<?php
$sqluser = '********';
$sqlpass = '********';
?>
========================


On 23/07/12 12:25, Michael E. Rentell 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



More information about the Kent mailing list