1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

SuPHP/phpSuExec Installed But have issues Help Me

Discussion in 'Site & Server Administration' started by Khansahib, Dec 16, 2009.

  1. #1
    Hello,

    Recently I have installed SuPHP/phpSuExec on my server.

    ==================================
    [root@server public_html]# /usr/local/cpanel/bin/rebuild_phpconf --current
    Available handlers: suphp dso cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled
    ==================================

    After installing it I have noticed that Memory Usage of my webserver is decreases is that because of SuPHP/phpSuExec?

    And secondly the main issue is that of .htaccess I mean in few places I really need .htaccess, but as we know that when running SuPHP/phpSuExec we have the following issue.

    I also tried adding that all coding in .htaccess to php.ini and Place the following code in .htaccess of that folder

    But its also not working.

    Please suggest me how to use .htaccess, and yes one of my friend told me to give 777 permission to .htacces it will work then, But its also not working.

    Please suggest me, I really want a solution.

    -Regards.
     
    Khansahib, Dec 16, 2009 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Any file chmoded to 777 will fail, and you will receive Internal Server errors. The .htaccess file should still work, for things like mod_rewrite and other common settings, you cannot however, place any sort of php_config values within these files. What are you trying to get to work in your current .htaccess file that is not working?
     
    RHS-Chris, Dec 16, 2009 IP
  3. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    here is what i have in .htaccess

    # Disable directory browsing
    #Options -Indexes

    # Follow symbolic links in this directory
    # Options +FollowSymLinks

    # Customized error messages
    ErrorDocument 404 /sms-messages/index.php

    # Set the default handler
    DirectoryIndex index.php

    <Files vote>
    ForceType application/x-httpd-php
    </Files>

    <Files submit>
    ForceType application/x-httpd-php
    </Files>

    please advice.
     
    Khansahib, Dec 16, 2009 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    Ok, and what is not working then?
     
    RHS-Chris, Dec 16, 2009 IP
  5. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    when I click the vote button or submit button it comes up with a box with option of Open with and Save as, Instead of opening the page.
     
    Khansahib, Dec 16, 2009 IP
  6. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #6
    And this was working prior to changing the handler to suphp? What version of apache are you running as well?
     
    RHS-Chris, Dec 16, 2009 IP
  7. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    yes it was working perfectly before, I am using latest version of Apache.
     
    Khansahib, Dec 16, 2009 IP
  8. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #8
    Try changing your code to this:

    <Files vote>
    ForceType x-httpd-php
    </Files>
    
    <Files submit>
    ForceType x-httpd-php
    </Files>
    Code (markup):
     
    RHS-Chris, Dec 16, 2009 IP
  9. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    After doing that now its coming up with blank page.
     
    Khansahib, Dec 16, 2009 IP
  10. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #10
    Can you check the error logs and see what they are reporting?

    You can also try SetHandler, and see if that works:

    SetHandler application/x-httpd-php
     
    RHS-Chris, Dec 16, 2009 IP
  11. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Don't you think its because of SuPHP/phpSuExec as php functions can't be used in .htaccess while running SuPHP/phpSuExec?
     
    Khansahib, Dec 16, 2009 IP
  12. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #12
    run the following:
    find /home/your_username/public_html/ -type f -exec chmod 644 {} \;
    find /home/your_username/public_html/ -type d -exec chmod 755 {} \;

    Then throw a php.ini in your public_html with all changes made.
     
    SecureCP, Dec 16, 2009 IP
  13. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #13
    What about the error log, can you post the tail end of it?
     
    RHS-Chris, Dec 16, 2009 IP
  14. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #14
    ok, take the following out of your .htaccess
    <Files vote>
    ForceType x-httpd-php
    </Files>
    <Files submit>
    ForceType x-httpd-php
    </Files>
    You won't need this, while testing.
    do NOT chmod your .htaccess to 777, it will break the site.
    You need to make sure all files and directories are owned by the user.
    Now, run the above commands I gave you. I'm seeing you're on a cPanel server, do the following:
    cp -pr /usr/local/lib/php.ini /home/your_username/public_html/

    Now make sure that you don't have php_value or php_flag in any of your .htaccess files, you'll want to edit the php.ini that you've just made in your user's public_html to reflect these values.

    Now after following the above instructions, your .htaccess should only have the following 2 lines of any relevance to the original:
    DirectoryIndex index.php
    ErrorDocument 404 /sms-messages/index.php

    ok, now check your site out. So long as all files/folders have ownerships of your user and files permissions = 644 and directories 755, your site will be loading.

    If you have further issues feel free to pm me and I'll be glad to take a look.
     
    SecureCP, Dec 16, 2009 IP
  15. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Well I have followed what you have recommended, I added the following lines php.ini

    .<Files vote>
    , ForceType application/x-httpd-php
    .</Files>
    ,
    .<Files submit>
    , ForceType application/x-httpd-php
    .</Files>

    But its still not working.
     
    Khansahib, Dec 17, 2009 IP
  16. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #16
    please dont put
    .<Files vote>
    , ForceType application/x-httpd-php
    .</Files>
    ,
    .<Files submit>
    , ForceType application/x-httpd-php
    .</Files>

    in your php.ini
     
    SecureCP, Dec 17, 2009 IP
  17. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #17
    kailash, Dec 17, 2009 IP
  18. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Khansahib, Dec 18, 2009 IP
  19. Khansahib

    Khansahib Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    i have done it by making the doing changes in .htaccess.

    RewriteEngine On
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1

    -Regards.
     
    Khansahib, Dec 18, 2009 IP