Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member eville's Avatar
    Join Date
    Jul 2004
    Posts
    21

    Default PHP is not working on any websites

    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. #2
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    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. #3
    Member Murtaza_t's Avatar
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    471

    Default

    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. #4
    Member
    Join Date
    May 2005
    Posts
    34

    Default

    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. #5
    Member eville's Avatar
    Join Date
    Jul 2004
    Posts
    21

    Default

    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. #6
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    log in as root

    then

    rm -fr /home/cpapachebuild

    then

    /scripts/easyapache

    select option 1 ,compile apache and see if php works then
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

  7. #7
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    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.
    Andy Reed
    RHCE and CCNA
    ServerTune.com

  8. #8
    Member eville's Avatar
    Join Date
    Jul 2004
    Posts
    21

    Default

    Quote Originally Posted by dave9000
    log in as root

    then

    rm -fr /home/cpapachebuild

    then

    /scripts/easyapache

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


    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. #9
    Member tuxdesk's Avatar
    Join Date
    Oct 2005
    Posts
    86

    Default

    Please check the libphp4.so is existing in libexec. Sometimes it is existing there with another name. (like libphp4.so.1)
    Tux
    Aim : tuxdesk
    Msn : tuxdesk@hotmail.com
    Yahoo: tuxdesk@yahoo.com

    __________________________________________________
    "You don't slow down because you get old; you get old because you slow down."

  10. #10
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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 ?
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

  11. #11
    Member eville's Avatar
    Join Date
    Jul 2004
    Posts
    21

    Default

    Quote Originally Posted by dave9000
    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 ?


    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. #12
    Member dave9000's Avatar
    Join Date
    Apr 2003
    Location
    arkansas
    Posts
    891
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    have the server reloaded with a minimum install of the OS and then reload cpanel this will most likely solve your issue
    Dave Browning
    Intersite Technologies
    Greenbrier Ar
    dave@isitetech.com

Similar Threads & Tags
Similar threads

  1. NO websites working on my server
    By Chriz1977 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-16-2010, 10:15 AM
  2. How to disable php for some websites
    By Danny_T in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-16-2007, 03:55 PM
  3. Fantastico not working: PHP not working in cPanel/WHM
    By softwareguy in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 05-25-2006, 02:38 AM
  4. Replies: 24
    Last Post: 01-13-2005, 02:04 AM
  5. All the websites are not working
    By murugan in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 08-04-2004, 12:17 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube