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 is not working on any websites

Discussion in 'General Discussion' started by eville, Feb 19, 2006.

  1. eville

    eville Member

    Joined:
    Jul 17, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hi Guys,

    I am having any issiue with PHP websites. The scripts wont run. When I try to visit a page with a php file extension my browser attempts to download a copy of the php file (not display it within the browser like it should).

    It calls it a type: type: application/x-httpd-php

    I've attempted this with 5 different browsers and all come up with the same problem.

    I rebuilt apache but the same problem occurs.

    Does anyone have any idea's why this may be happening after a fresh install of Cpanel?
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    If this is following a fresh install, you might want to try a reinstall incase the install didn't go smoothly:

    /scripts/upcp --force

    If that doesn't help, check your Apache config in /usr/local/apache/conf/httpd.conf.

    If you're using the PHP module, check that you have:

    Code:
    LoadModule php4_module libexec/libphp4.so
    near all the other LoadModule directives, or similar if you are using PHP5 (somewhere near the top of the config!). If you are using phpsuexec (i.e. CGI mode and not module), ensure that this line is commented out if present.

    Check also that Apache has the correct handlers. If it hasn't been told to parse PHP scripts with anything, it won't! In my config I have:

    Code:
    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
    Action application/x-httpd-php5 "/cgi-sys/php5"
    AddType application/x-httpd-php5 .php5
    It is likely to be different for you unless you are running both PHP4 and PHP5 - check what PHP version(s) you are running and check that the config is right for you.

    You should fine the handlers loitering around somewhere inside the <IfModule mod_mime.c> directive (or at least I do).
     
  3. Murtaza_t

    Murtaza_t Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    476
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Earth
    cPanel Access Level:
    Website Owner
    Yes... Your problem maybe in what webignition said, if it does nt work then just paste the .htaccess here... let us see what does it have..?
     
  4. agressor

    agressor Active Member

    Joined:
    May 15, 2005
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Just rebuild apache. If the problem persist, type (as root, in ssh obvius):

    php -i | grep php.ini

    and this give u the path of php.ini

    Delete the line of Zend (if this exist) or other module added in php.ini. Remembser this stay in the last of file. and restart httpd

    httpd restart


    Sorry for my bad english.
    reggards
     
  5. eville

    eville Member

    Joined:
    Jul 17, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I've been working on getting Apache / PHP working again and have followed some of your advice. The main problem we've been having so far is that the LoadModule line actually creates an error when httpd is run:

    Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration

    (It fails on the LoadModule line for PHP.)

    For whatever reason, Cpanel isn't building Apache with module support. Any ideas?
     
  6. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    log in as root

    then

    rm -fr /home/cpapachebuild

    then

    /scripts/easyapache

    select option 1 ,compile apache and see if php works then
     
  7. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Murtaza_t, agressor, dave9000, and webignition provided good information to help you solve this issue. Thank you, guys :) Well; since none of these suggestions worked, I suggest you hire a sys admin. I am really amazed that you've been working on this issue since Febraury 19th. :eek:
     
  8. eville

    eville Member

    Joined:
    Jul 17, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1


    Thanx dave9000. I tried that but the problem is still here. I'm going to try to play around with the httpd file a little more. If i can't get it fixed by Saturday i'm just going to get some support from Cpanel.


    AndyReed: thanks for thanking the people that helped me. Just some advice for the future though. Concluding other people's efforts without helping yourself while pluging your own services does not exactly equate to good salesmanship qualities.
     
  9. tuxdesk

    tuxdesk Well-Known Member

    Joined:
    Oct 1, 2005
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Please check the libphp4.so is existing in libexec. Sometimes it is existing there with another name. (like libphp4.so.1)
     
  10. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    Off the wall thought here.

    Was the OS installed with a minimun install or did the server get a full install of the OS?

    Possible mutli httpd and php packages installed on the server and maybe the wrong one running or the wrong libs being linked in on compile ?
     
  11. eville

    eville Member

    Joined:
    Jul 17, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1


    yea, the server was installed with Apache.


    I've thought that could be causing the conflict. Because both apache's seem to be working. I actually set a page up on the first apache and it still seems to be working when you just type in the IP address of the page.
     
  12. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    have the server reloaded with a minimum install of the OS and then reload cpanel this will most likely solve your issue
     
Loading...

Share This Page