You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Imrani <pr...@yahoo.com> on 2005/12/11 23:20:19 UTC

[users@httpd] Apache2 with Php5

  Hi,
   
  I have installed Apache2 with PHP5 support on FreeBSD 6.0 using ports collection. The installation process seemed to have gone fine but for some reason apache is not able to process the PHP files. It displayes all the code on the browser without processing. Does anyone know why this may be happening?
   
  More info is as follows:
   
  1. Noticed that there is php5 module in apache's httpd.conf. Does this prove that apache is configured with php?
   --> LoadModule php5_module        libexec/apache2/libphp5.so

  2. Added/Edited following lines in httpd.conf
  --> DirectoryIndex index.html index.html.var index.php
--> AddType application/x-httpd-php .php
  --> AddType text/html .shtml .php

  3. Saved and restarted apache, but situation is still same.
   
  4. I can execute the php file from command line:
  --> #localhost> php test.php
  this file use mysql_connect and mysql_close functions and executes pretty fine. But when I try to view in the browser, it displays just all that text that is NON-HTML. 
   
  5. file test.php has ownner group as www which is same user that is running apache and file permissions are 644 (rw-r--r--)
   
  Hope this gives enough info. Please let me know if I need to do more.
   
  Thank you,


			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

Re: [users@httpd] Apache2 with Php5

Posted by Imrani <pr...@yahoo.com>.
Thanks Rich,
   
  It worked like a charm.

  - Imrani
   
  
Rich Bowen <rb...@rcbowen.com> wrote:
  Imrani wrote:
> 
> Hi,
> 
> I have installed Apache2 with PHP5 support on FreeBSD 6.0 using ports 
> collection. The installation process seemed to have gone fine but for 
> some reason apache is not able to process the PHP files. It displayes 
> all the code on the browser without processing. Does anyone know why 
> this may be happening?


> --> AddType application/x-httpd-php .php
> --> AddType text/html .shtml .php

That second line overrides the first one.
What you want instead is:

AddHandler application/x-httpd-php .php

-- 
Rich Bowen
rbowen@rcbowen.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

  


			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

Re: [users@httpd] Apache2 with Php5

Posted by Rich Bowen <rb...@rcbowen.com>.
Imrani wrote:
> 
> Hi,
>  
> I have installed Apache2 with PHP5 support on FreeBSD 6.0 using ports 
> collection. The installation process seemed to have gone fine but for 
> some reason apache is not able to process the PHP files. It displayes 
> all the code on the browser without processing. Does anyone know why 
> this may be happening?


> --> AddType application/x-httpd-php .php
> --> AddType text/html .shtml .php

That second line overrides the first one.
What you want instead is:

AddHandler application/x-httpd-php .php

-- 
Rich Bowen
rbowen@rcbowen.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org