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.

Update 11.1 - PHP code exposed

Discussion in 'General Discussion' started by corey4908, May 5, 2007.

  1. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Updated to 11.1 and now, for some reason I can't fathum, all PHP pages show the HTML only. The PHP code is viewable in browsers' view source, instead of being server-parsed (securiy risk, other than the fact PHP itself not running - so a moot point:eek: ). Changes to php.ini ? Any ideas highly appreciated:eek:

    Added notes

    1)In WHM, when going to "Config File Rollback" for "/usr/local/apache/conf/httpd.conf", no matter how far role-back with the Revision chooser at bottom, ALL appear BLANK:( This dispite the fact that /usr/local/apache/conf/httpd.conf itself is populated with configuration data in SSH.

    2) No domains show up in WHM "List Acounts".
     
    #1 corey4908, May 5, 2007
    Last edited: May 5, 2007
  2. firedragon

    firedragon Registered

    Joined:
    Feb 1, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    yeah i got the same problem....

    troubleshooting it right now...
     
  3. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Trying to replicate this now.
     
  4. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cpanelnick,,

    By using the following (I wonder about order ran in), I solved atleast part of the problem:

    cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.old
    /scripts/rebuildhttpdconf >> /etc/httpd/conf/httpd.conf
    /scripts/updateuserdomains
    /scripts/rebuildhttpdconf

    Now domains showing up in List Accounts. However, PHP still not being parsed...:)
    Thanks for your help, in advance, by the way:rolleyes:
     
    #4 corey4908, May 5, 2007
    Last edited: May 5, 2007
  5. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Try this

    Update to 11.2.2-CURRENT_11673

    Go into the php config editor in whm
    Go into advanced mode
    Save the config.


    11.2.2-CURRENT_11673 added some logic to repair any errors in the php.ini.
     
  6. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cpanelnick,

    That worked for me:rolleyes: PHP now parsing as it should. Thanks:D

    Now if could only get one site (and sadly it is my hosting biz domain...my luck:p ) to work again...getting 403 Forbidden errors on all its pages (even image URL's). Guess I better get reading forums some more..lol, or my current clients may stay for a bit (freely hosted and only care their own sites run:cool: ) but won't have own site to attract newcomers:mad:

    Thanks again;)
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Did you check /usr/local/apache/logs/error_log ?
     
  8. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Showing the following (where xxx is the username):

    [Sat May 5 15:44:40 2007] [error] [client 200.00.0.00] Directory index forbidden by rule: /home/xxx/public_html/admin/
    [Sat May 5 15:44:40 2007] [error] [client 200.00.0.00] File does not exist: /home/xxx/public_html/admin/errors/errors.php
    [Sat May 5 15:44:42 2007] [error] [client 200.00.0.00] Directory index forbidden by rule: /home/xxx/public_html/admin/
    [Sat May 5 15:44:42 2007] [error] [client 200.00.0.00] File does not exist: /home/xxx/public_html/admin/errors/errors.php
    [Sat May 5 15:47:59 2007] [error] [client 200.00.0.00] File does not exist: /home/xxx/public_html/admin/admin.gif
    [Sat May 5 15:47:59 2007] [error] [client 200.00.0.00] File does not exist: /home/xxx/public_html/admin/errors/errors.php

    /home/xxx/public_html/admin/ doesn't even exist! All of those should be in /home/xxx/public_html/ itself. Oddly, /etc/httpd/conf/httpd.conf doesn't have the directory "/admin/" refferanced as root for that directory. It lists the following:

    <VirtualHost xxx.xxx.xxx.xxx:80>
    ServerAlias www.mydomain.net mydomain.net
    ServerAdmin webmaster@mydomain.net
    DocumentRoot /home/xxx/public_html
    User xxx
    Group xxx
    ServerName www.mydomain.net
    CustomLog domlogs/mydomain.net combined
    ScriptAlias /cgi-bin/ /home/xxx/public_html/cgi-bin/
    <IfModule mod_suphp.c>
    suPHP_UserGroup xxx xxx <<-- Username appears twice here, but it also is this way in other working domains.
    </IfModule>
    BytesLog /usr/local/apache/domlogs/www.mydomain.net-bytes_log
    </VirtualHost>


    Has me confused, how get Not Found and Access Denied via a referance to a folder that doesn't exist:confused: And this only domain its doing i too.
     
  9. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    Check the .htaccess file in /home/USER/public_html
     
  10. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    and...the drama continues........

    Options All -Indexes
    AddHandler application/x-httpd-php .exe
    AddHandler application/x-httpd-php .aspx
    DirectoryIndex do.exe do.php
    ErrorDocument 400 /errors/errors.php?400
    ErrorDocument 401 /errors/errors.php?401
    ErrorDocument 402 /errors/errors.php?402
    ErrorDocument 403 /errors/errors.php?403
    ErrorDocument 404 /errors/errors.php?404
    ErrorDocument 500 /errors/errors.php?500

    Both AddHandlers , like the rest of the above, had been there and worked before. They were used to confuse any nasty script that may end-up searching for default .html/.htm/.php ect (I believe the common Metasploit - If I'm not confusing something else..lol - comes to mind, which can be used to overwrite server-wide default known-name index files). As stated, all had worked..as this .htacces hasn't been changed in forever. And, site index is "do.php", with some sub-directories using "do.exe" instead - as they have been way before this problem.

    By the way, just incase update changed something that would effect the above working. I even tried with a blank .htaccess file and renaming do.php - to no avail, sadly.

    But, you're right...Obvious first place to point any newbie to look would be in .htaccess:cool:
     
  11. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider

    Go ahead and open a ticket :)
     
  12. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Ticket Submitted! Thanks for the help here:D
     
  13. orware

    orware Member

    Joined:
    Jul 27, 2005
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Domain.com or www.Domain.com working but not both

    EDIT: Just got a reply from my webhost and they said everything loaded fine at the data center and that it was my browser cache (makes sense...I tend to have about 40 tabs open in Firefox most of the time).

    Hi I woke up this morning to this problem as well.

    I fixed the List Accounts problem by deleting all of the current home accounts, clearing out the users and group ids from /etc/passwd and /etc/groups and then restored from this morning's daily backup and the websites were visible again (at least some of them).

    Then I noticed that I had the same problem with the PHP scripts not being parsed. If you go to one of these sites in Firefox all that pops up a download box (which if you download the file you'll see it's the index.php for your site, unparsed).

    Another issue I'm having is that this only happens on either a domain.com or www.domain.com basis. Let me illustrate:

    Example 1: defiancemayhem.com will work, but www.defiancemayhem.com will show the cPanel splash page

    Example 2: jsconcessions.com will popup with a download box asking you to save a file (your index.php, unparsed), but www.jsconcessions.com takes you to the actual website and parses the php (if you try to go here you'll see something about the license being invalid...that's because I just moved to a new server and the software on the site requires ioncube and tracks the software via IP...the software hasn't been updated yet to accomodate for the new server's IPs).

    It's kind of weird and I've put in a support request with my webhost for them to check it out, but I don't know if it would be in their power or not.

    Thank you,

    -Omar

    P.S. I didn't know how to get into that PHP Config page you mentioned (are you talking from within the Update Apache page?)
     
    #13 orware, May 7, 2007
    Last edited: May 7, 2007
  14. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Sorry about late reply, Omar:rolleyes: After got my problem resolved, didn't come back to forums right away.
    In WHM. I'm not sure what version this was added in. But sure makes changing PHP settings a bit easier than having to SSH into php.ini:)

    [​IMG]
    Glad to hear didn't go round and round like me:p But thankfully, cPanel folks got it all figured out:D
     
  15. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    What you describe is not a function of upgrading to Cpanel 11 but rather
    that you got a bad compilation of PHP.

    When compiling PHP with Cpanel's EasyApache script, there is 2 things
    that can (and often does) happen that will cause your PHP code to
    be downloaded instead of executed by the PHP interpreter.

    1) EasyApache is not so good with sanity checks and will happily try
    to install the PHP module or CGI after the PHP compile failed
    which leaves you with a broken PHP installation requiring at the
    very least a recompile of PHP.

    2) Many times, EasyApache will leave the "LoadModule" line in the
    /etc/httpd/conf/httpd.conf line for the PHP module commented
    out which effectively disables PHP support and will cause your
    PHP scripts to be downloaded instead of executed.

    It is because of the above 2 items that I always recommend
    manually compiling PHP yourself and not using EasyApache.

    It is actually much simpler and fare more reliable to compile
    PHP manually than rely on the Cpanel script for that.

    Basically ...

    1. Download the source from php.net

    2. Unpack the archive

    3. Run "./configure" with the same options shown in your current phpinfo() screen

    4. Type "make"

    5. Type "make test"

    6. Type "make install"
     
  16. corey4908

    corey4908 Member

    Joined:
    Apr 6, 2002
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    TY Spiral for the advice
     
  17. flash7

    flash7 Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    16
    WHM 11.1.0 cPanel 11.2.11-C12007

    Can't update from php 4.4.6 to PHP 5.x.x in WHM :eek:

    Also tryed manualy from source php 5.2.2 with the same error:
    Code:
    Syntax error on line 58 of /usr/local/apache/conf/httpd.conf:
    Cannot load /usr/local/apache/libexec/libphp5.so into server:
    /usr/local/apache/libexec/libphp5.so: undefined symbol:
    xmlTextReaderSchemaValidate
    What can I do?

    Thanks
     
  18. rgripoll

    rgripoll Active Member

    Joined:
    Mar 19, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Problem with php

    Fixed with cpanelnick's solution. Remember to restart your navigator after doing this.
     
    #18 rgripoll, May 20, 2007
    Last edited: May 20, 2007
  19. rgripoll

    rgripoll Active Member

    Joined:
    Mar 19, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    It's failing again.

    httpd.conf and php.ini seem to be ok... any ideas?
     
    #19 rgripoll, May 25, 2007
    Last edited: May 25, 2007
  20. isputra

    isputra Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    576
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Mbelitar
    After doing this, now my php status give me :

    root@server [~]# php -v
    Failed loading 1: 1: cannot open shared object file: No such file or directory
    PHP 4.4.6 (cli) (built: Apr 4 2007 20:14:44)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.2.6, Copyright (c) 1998-2007, by Zend Technologies

    What's wrong with this ? Please help me.
     
Loading...

Share This Page