Hi! I'm trying to setup up a web page that will eventually be hosted
but I want to develop it locally. It will use PHP to hit a MySQL
database. So I have a local database created. I installed PHP and
Apache. Next I thought I would do some basic PHP tests as I don't know
anything about PHP or Apache. So here is where my snag is.
1) I can execute at the command line:
who@where:/var/www/htdocs$ php -r 'echo "hiya\n";'
hiya
so this seems to work and makes me think PHP is a ok.
2) If I have /var/www/htdocs/my_web/test.php as following:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
what
<?php echo('hiya\n'); ?>
</body>
</html>
an open test.php in firefox I get nothing at all
3) If I have /var/www/htdocs/my_web/test.php as following:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
what
<?php echo('<p>hiya\n</p>'); ?>
</body>
</html>
an open test.php in firefox I get:
hiya\n
'); ?>
So forget logging into my database just yet! What am I doing wrong? It
seems PHP is not being processed correctly via Apache but based on the
PHP command line I think the problem is in Apache? Perhaps a missed
configuration? I've been trying to use the tutorial here:
http://us3.php.net/manual/en/tutorial.firstpage.php
to get a grasp but I'm in a holding pattern until I can get these
simple examples to work! In addition, I'm currently running my MySQL
database from /var/lib/mysql/my_db...when I go to host this will it be
stored in my main web directory? If so, can I make this db run from
/var/www/htdocs/my_web to simulate this in my local development?
Thanks!