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.

Upgraded to php 5 and now having problems with https

Discussion in 'General Discussion' started by noimad1, Mar 23, 2009.

  1. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    I just upgraded one of my servers to php5 and now I'm having a problem with the root of domains that use ssl.

    Here's what I mean:

    if I go to

    https://mydomain.com

    it pulls up the dialogue box that wants me to download the file, and the page doesn't come up.

    but if I pull up

    https://mydomain.com/index.html

    It loads fine. Anyone else seen this before?
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    I wonder if this is doing the same thing with http:// as well?

    Check your index handler and be sure html files are indeed listed.

    Service Configuration > DirectoryIndex Priority

    Just a thought.
     
  3. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Well the problem magically fixed itself. I don't know what happened....
     
  4. noimad1

    noimad1 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Ahh....i think i figured it out, but now it brings up another issue. It turns out he had this in his .htaccess file:

    #AddHandler application/x-httpd-php .htm
    #AddHandler application/x-httpd-php .html
    #AddType application/x-httpd-php .htm
    #AddType application/x-httpd-php .html


    so that his .html files would be parsed as php. Is there a new way to write that?
     
  5. tkerns

    tkerns Active Member

    Joined:
    Jun 13, 2007
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Easy Apache 3 commented out those addHandler directives.
    Change them to

    AddType application/x-httpd-php5 .html .htm
    AddHandler application/x-httpd-php5 .html .htm

    and you should be good.

    Tom
     
  6. gkgcpanel

    gkgcpanel Well-Known Member

    Joined:
    Jun 6, 2007
    Messages:
    217
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    So, why is EasyApache commenting those lines out? This just started happening to one of our servers 2 days ago, and each time I reconfigure PHP, some sites (not all of them) get the AddHandler application/x-httpd-php5 .html .htm .php line commented out. Then those sites will no longer work, the index.php file wants to keep getting downloaded instead of executed. Uncommenting those lines in .htaccess will fix the issue. However, do I have to do this for every single site that is reporting a problem??? And then do this again each time I run easyapache??

    There was another threat that said I should modify the Tweak Settings to only go 2 levels deep while scanning .htaccess files. It's already set to 2 (default). And some of these sites it's happening under their public_html folder, so I don't think that's the issue...

    HELP!!! I Don't want to have to do this for 1100 sites on the server.. That will take way too much time.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you want this to be added for all sites, you could trying putting the lines as an include at the following location:

    Code:
    mkdir -p /usr/local/apache/conf/userdata/std/2
    In this path, std stands for the http VirtualHost entries (not the https) and 2 for Apache 2 or Apache 2.2. At that location, create a file called phphttp.conf and put the include lines. Because you are putting it at the level before the accounts, all accounts should use the include entries.

    To verify the include works, you would then run:

    Code:
    /scripts/verify_vhost_includes
    After checking out it works fine, you would check it into the system:

    Code:
    /scripts/ensure_vhost_includes --all-users
    You may want to backup Apache first:

    Code:
    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.bak110301
    After that, you could rebuild Apache and restart it:

    Code:
    /scripts/rebuildhttpdconf
    /etc/init.d/httpd restart
    I suggest having a non-working site to test that it begins working after you do the above steps.

    Thanks.
     
  8. gkgcpanel

    gkgcpanel Well-Known Member

    Joined:
    Jun 6, 2007
    Messages:
    217
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Actually the global fix was to add the following line to /usr/local/apache/conf/php.conf

    Code:
    AddHandler application/x-httpd-php5 .php
    Right above the AddType rule that was already in place. Why (on this server) it started failing after running EasyApache is the real mystery.
    The other servers all work fine (and they don't have this line in php.conf either)...
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Unfortunately, that will not be a global permanent fix. Anytime EasyApache recompiles or you re-save WHM > Apache Configuration > PHP and SuExec Configuration area, the /usr/local/apache/conf/php.conf file will be overwritten. This is why I suggested an include instead to add that option for all accounts. Includes in the manner I noted do not get overwritten periodically.

    Otherwise, you'll need to remember to revise the file every time you recompile Apache. Also, you might want to add the file to the exclude list in case cPanel upcp ever modifies it either:

    Code:
    echo "/usr/local/apache/conf/php.conf" >> /etc/cpanelsync.exclude
     
Loading...

Share This Page