The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP code not interpreted

Discussion in 'General Discussion' started by Constantin, Apr 9, 2007.

  1. Constantin

    Constantin Member

    Joined:
    Dec 9, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I have one issue, please give me a hint:

    PHP 5.2.1 installed on WHM 10.8.0 cPanel 10.9.0-C9565

    If I load a php file on browser, it gets loaded, but in HTML source I can see php code.
    If I run in SSH "php info.php", the php code gets runn and normal output is generated.

    I checked these lines in httpd.conf:
    LoadModule php5_module libexec/libphp5.so
    AddModule mod_php5.c
    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml


    "php -v" returns:
    PHP 5.2.1 (cli) (built: Apr 9 2007 10:38:29)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies
    with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies


    On php.ini I have:
    ; Enable the PHP scripting language engine under Apache.
    engine = "On" ;engine

    I use long tags ("<?php").

    I recompiled Apache and PHP few times, both from WHM and from SSH. I reinstalled Zend optimizer.

    Please let me know if you have any hint.

    Thanks.
     
  2. Constantin

    Constantin Member

    Joined:
    Dec 9, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    This is fixed :)

    In php.ini I had this line:

    engine = "On"

    It should be without quotes :)

    engine = On
     
  3. kingdommedia

    kingdommedia Member

    Joined:
    Mar 1, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    addhandler

    does the
    AddHandler application/x-httpd-php .php .php4 .php3
    have to go prior to the AddType definitions?

    I'm trying to run php within .html files, would
    AddHandler application/x-httpd-php .php .php4 .php3 .html
    be better?
     
Loading...

Share This Page