NYCPHP Meetup

NYPHP.org

[nycphp-talk] Newbie seeks PHP installation help / suggestions

inforequest 1j0lkq002 at sneakemail.com
Sat Dec 9 16:02:21 EST 2006


Bob Paul Bob-at-madison-atlantic.com |nyphp dev/internal group use| wrote:

> Hello,
>  
> I am totally new to PHP and NYPHP.  I've been trying for several days 
> now to install PHP, Apache and MySQL on my Win/XP system.
>  
> The Apache web server is functioning but I'm lost in the PHP 
> configuration files and have not a clue how to activate PHP.  The 
> Apache web server totally ignores the PHP script inside my little 
> HelloWorld.php -
>  
> <html>
>  <head>
>   <title>PHP Test</title>
>  </head>
>  <body>
>  <p>Hello World from HTML</p>
>  <?php echo '<p>Hello World from PHP</p>'; ?>
> </body>
> </html>
>  
> I'm about to start searching through the NYPHP message archives, but 
> if you happen to know a link that will help me, I'd greatly appreciate 
> hearing about it.
>  
> All the best,
> Bob
>
If you go the prepackaged LAMP route, there is also EasyPHP, XAMPP, and 
WAMP for windows. All good installers,  none good for a public machine 
(security reasons).

Since your test file is HTML with embedded PHP, I assume it is named 
something.html or something.htm? In that case Apache will not pass it to 
the PHP engine by default. Check by looking at the source of the output 
page.. if you see the embedded PHP code that's what happened.

Rename it something.php and try again.

If you want to pass your .html files through PHP (some people do), you 
need to modify Apache's httpd.conf  or use an htaccess file to add the 
.html extension as a PHP application file type. For .php and .html  the 
line looks like this:

 AddType application/x-httpd-php .php .html

For edumacational purposes, the best test file might be one like this:

<html>
<head>
<title>PHP test Fle</title>
</head>
<body>
<h1>This is HTML, and what follows is my php configuration:</h1>
<?php
phpinfo();
?>
</body>
</html>

-=john andrews

-- 
-------------------------------------------------------------
Your web server traffic log file is the most important source of web business information available. Do you know where your logs are right now? Do you know who else has access to your log files? When they were last archived? Where those archives are? --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com




More information about the talk mailing list