[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache and PHP don't quite work



On Fri, May 23, 2003 at 11:46:39PM +0200, Roberto Sanchez wrote:

> Turning it into a .php file worked.  I was under the (mistaken)
> impression that because "PHP can be embedded in html," the browser
> would handle it correctly.  

I believe you mean "server would handle it correctly".  The idea of PHP
and other server side languages (unlike javascript) is that the server
does the parsing and execution, not the browser.

> Why is it like that? 

Rather than parsing all content of all files, it uses the extension as
an indication of which files are which.

> How do I make the index.html file redirect to the index.php file (can
> you tell I am totally new at this)?  That way I can enter
> http://localhost/ in my address bar and the get the correct PHP page?

You can make "index.php" a valid DirectoryIndex in your
/etc/apache/httpd.conf take a look for the following section:

   <IfModule mod_dir.c>
      DirectoryIndex index.html index.htm index.shtml index.cgi
   </IfModule>

Just add "index.php" to that line and restart Apache.

-- 
Jamin W. Collins

Remember, root always has a loaded gun.  Don't run around with it unless
you absolutely need it. -- Vineet Kumar



Reply to: