Hi,
I am totally new to PHP.
Am developing on Mac OS X 10.6.7, Apache Server 2.2.17, MySQL 5.1.39.
All of the above works fine when I develop web pages using Perl CGI with Perl DBI.
I am now trying to learn PHP and am having difficulty getting the first test script to run.
Rather than installing MAMP as recommended in Robin Nixon's book (O'Reilly) on the subject,
I'd like to just enable PHP 5 which is dielivered with the Mac OS X.
To that end I have followed the instructions at
http://maestric.com/doc/mac/apache_p...l_snow_leopard
(which I found referenced on the Apple Support Forums).
The simple test script that I am trying to run is shown at the end of this post (file a.php):
If I put the URL address file:///Users/andynic/a.php in Safari, rather then putting up "Welcom to PHP First Test"
it puts up the code you see above.
Any idea about what I have done wrong?
Thanks for your help.
Andynic
File a.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhml1-strict.dtd">
<?php
$name = "First Test"; // declaration
?>
<html>
<head>
<title>Test PHP</title>
</head>
<body style='font-family:Arial; font-size:18px;'>
Welcome to PHP, <?php print( "$name" ); ?>
</body>
</html>