Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default Upgraded to php 5 and now having problems with https

    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. #2
    Member
    Join Date
    Mar 2006
    Posts
    1,215

    Default

    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. #3
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    Well the problem magically fixed itself. I don't know what happened....

  4. #4
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    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. #5
    Member tkerns's Avatar
    Join Date
    Jun 2007
    Posts
    33

    Default

    Quote Originally Posted by noimad1 View Post
    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?
    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. #6
    Member
    Join Date
    Jun 2007
    Posts
    150

    Default Re: Upgraded to php 5 and now having problems with https

    Quote Originally Posted by tkerns View Post
    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
    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. #7
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Upgraded to php 5 and now having problems with https

    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.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  8. #8
    Member
    Join Date
    Jun 2007
    Posts
    150

    Default Re: Upgraded to php 5 and now having problems with https

    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. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Upgraded to php 5 and now having problems with https

    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
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Help! Can't connect MySQL after upgraded PHP 4.4.4 to 4.4.7
    By taotoon in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 04-25-2008, 02:33 PM
  2. Upgraded to PHP 5 and simple includes are not working
    By sh4ka in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-06-2007, 08:34 AM
  3. Upgraded from cPanel 11 Edge to latest version some problems
    By stargatesg1 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-08-2007, 06:00 PM
  4. Upgraded to Edge, now PHP won't work..
    By TRayT in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-31-2007, 10:58 AM
  5. upgraded to php 5.0.5!!!!
    By SetLar8 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-02-2005, 02:33 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube