Results 1 to 16 of 16

Thread: phpsuexec

  1. #1
    Join Date
    Mar 2003
    Location
    Charlotte, NC
    Posts
    2,760

    phpsuexec

    When I install phpsuexec, most scripts give an internal server error. I believe it's because scripts are either CHMODed incorrectly or owned by "nobody". Is there any CPanel script to run in order to fix the permissions? I know there's something like this for CGI scripts and suexec.

    Thanks!

  2. #2
    Join Date
    Jul 2003
    Location
    Nothing but, net
    Posts
    2,062
    /scripts/fixsuexeccgiscripts

    If you're changing from mod_php to phpsuexec it is a good idea to just cron that fix script to run every 5 minutes for the first couple of days.

  3. #3
    Join Date
    Aug 2002
    Location
    DC
    Posts
    3,635
    That didn't work - I visited a php script that brought up an error, ran /scripts/fixsuexeccgiscripts, but it didn't do anything. The errors are showing up the the suexec error log though, so the script should be working. I can't figure out why it didn't work, Josh couldn't figure it out either. Any other ideas?

    - Matt

  4. #4
    Join Date
    Mar 2003
    Location
    California USA
    Posts
    13,290
    do you have any .htaccess files? php_admin functions cannot be there
    Steven Ciaburri | Industry's Best Server Management - Rack911.com
    Software Auditing - 400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com
    Fully Managed Dedicated Servers (Las Vegas, New York City, & Amsterdam) (AS62710)
    FreeBSD & Linux Server Management, Security Auditing, Server Optimization, PCI Compliance

  5. #5
    Join Date
    Apr 2000
    Location
    California
    Posts
    3,051
    Originally posted by mainarea
    That didn't work - I visited a php script that brought up an error, ran /scripts/fixsuexeccgiscripts, but it didn't do anything. The errors are showing up the the suexec error log though, so the script should be working. I can't figure out why it didn't work, Josh couldn't figure it out either. Any other ideas?

    - Matt

    There are probably a dozen reasons why this could be erroring. Be sure that the User/Group directives are in their virtualhost block in the Apache configuration file. Be sure that you don't have "web root protection" enabled when you compile Apache w/ Cpanel's easyapache script (this is broken logic on Cpanel's part).

    Be sure to remove the /var/cpanel/fileprotect file, if it exists, as that will enable the web root protection feature if it exists, and Cpanel will set the ownership and permissions on the user's web root directory to a setting that is invalid for suexec/phpsuexec and it will cause scripts to error due to the suexec checks (this is a good thing).

    Be sure that any PHP scripts are set to the permissions of 644, 755, 750 or 700. Be sure that any directories the scripts are in are set to either 711 or 755. As another person suggested, check the .htaccess file for any php_flag directives, as those will cause the site to error as those are only valid in the Apache API (mod_php, no phpsuexec). Finally, you should provide the suexec_log and error_log data from the errors if it's still a problem, so someone here can suggest what might be wrong.

  6. #6

    phpsuexec problem

    I am having a similar problem. Although i have very carefully followed all the steps mentioned above. All dirs are chmod 755, files are chmod 644."Web root protection was disabled " when compiling php in WHM.

    I am still getting 500 internal server error. the error_log says

    premature end of script headers.

    Plz help. has anybody successfully run phpsuexec on a WHM/cpanel server.

    help will be appreciated

    khalid

  7. #7
    Join Date
    Jun 2005
    Posts
    697
    It can also be caused by symbolic links to files, you may want to check that.
    ReflexNetworks means Happy Clients!

  8. #8

    phpsuexec problem

    nopes there are no symbolic links. i get the following in /usr/local/apache/logs/erro_log


    [Thu Apr 20 12:08:18 2006] [error] [client xx.xxx.xx.xx] Premature end of script headers: /home/xxxx/public_html/xxx.php
    [Thu Apr 20 12:08:18 2006] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    failed to open log file
    fopen: Permission denied

  9. #9
    Join Date
    Jun 2005
    Posts
    697
    Quote Originally Posted by knkhan
    [Thu Apr 20 12:08:18 2006] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    Stop apache and then restart it. That will get rid of this error in my experience. You have to stop apache, restart won't do.
    Any chance you are on a 64bit OS?


    Quote Originally Posted by knkhan
    failed to open log file
    fopen: Permission denied
    Permission problem on the logfile?
    ReflexNetworks means Happy Clients!

  10. #10
    a have the same problemn

  11. #11
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    Quote Originally Posted by devilsoulblack View Post
    a have the same problemn
    What do the Apache error logs show, premature end of headers?
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

  12. #12
    Quote Originally Posted by Pat H View Post
    What do the Apache error logs show, premature end of headers?

    [Sat Jun 9 10:26:34 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:38 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:39 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:40 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:42 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:42 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:43 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    [Sat Jun 9 10:26:44 2007] [error] (22)Invalid argument: setrlimit(RLIMIT_AS): failed to set memory usage limit
    { No HopE & No FeaR }
    Be part of the change, because We are the change..

  13. #13
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    8,910
    You could try removing the RLimitMEM & RLimitCPU settings at the top of your httpd.conf, if it exists.

    /usr/local/apache/conf/httpd.conf

    Then restart Apache...
    Patrick William | RACK911 Labs | Software Security Auditing
    400+ Vulnerabilities Found - Quote @ https://www.RACK911Labs.com

    www.HostingSecList.com - Security notices for the hosting community.

  14. #14
    Have you built a CGI version of PHP?
    LiteSpeed Web Acceleration Platform by http://www.litespeedtech.com
    Apache drop-in replacement. Triple server capacity with 10X performance increases.
    Ultimate web serving platform for WordPress, Magento and other web applications.
    Turbo charging all WordPress sites hosted on your server with a single click!

  15. #15
    Join Date
    Apr 2003
    Location
    Brooklyn NY
    Posts
    213
    it wouls normally be because of PHP flags in .htaccess files, you should comment them out and then if you need register_globals for example, you woudl need to create a php.ini file in the folder of the script and type in it: register_globals = On

    There can be many reasons for the errors, but this is the most common one.

  16. #16
    Join Date
    Nov 2004
    Location
    Australia
    Posts
    1,683
    That setrlimit is unlikely to be the cause of the problem; some versions of Apache produce that error under normal operations. I'd look for writable files or directories, or php settings in .htaccess files, as others have posted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •