Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Sep 2004
    Posts
    69

    Exclamation Apache, php and suexec problem... URGENT

    Hello!!

    After an update of apache from version 1.3.34 to 1.3.36 phpsuexec does not work longer...

    We have tried everything to get it back running... PHP 5.1.2 and PHP 5.1.4 and also 5.0.5... nothing... but all three version work as apache modul...

    After this message in WHM in apache-update
    * This is buildapache version 1.5.402 (for cpanel <= 10.9.3) (ap=1.3.36) *
    phpsuexec and/or (we tried both) be activated, we can not run any php script which are hosted on our server...

    In the suexec_log we found the following message:
    [2006-05-31 08:26:59]: info: (target/actual) uid: (user/user) gid:
    (user/user) cmd: index.php
    [2006-05-31 08:26:59]: error: file has no execute permission:
    (/home/user/public_html/index.php)


    How can we solv the problem? It is a little bit urgent, because all hosted sites with php does not work longer....

    Greetings...

    KimBO

  2. #2
    BANNED
    Join Date
    Jul 2005
    Posts
    537

    Default

    Have you tried php 4.2.2 complied as CGI phpsuexec?

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    Quote Originally Posted by KimBO
    In the suexec_log we found the following message:
    [2006-05-31 08:26:59]: info: (target/actual) uid: (user/user) gid:
    (user/user) cmd: index.php
    [2006-05-31 08:26:59]: error: file has no execute permission:
    (/home/user/public_html/index.php)
    A bit of a hint perhaps - what are the permissions on the script? Perhaps it has no execute permissions?

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    17

    Default Solution

    Its an old thread..still i am posting the solution...

    Problem:-

    After compiling phpsuexec you are getting 500 errors when accessing php files...

    apache error_log shows

    Premature end of script headers: /home/xxxx/public_html/index.php

    suexec_log shows

    info: (target/actual) uid: (xxxx/xxxx) gid: (xxxx/xxxx) cmd: index.php
    error: file has no execute permission: (/home/xxxx/public_html/index.php)

    Solution:-

    Check httpd.conf (/usr/local/apache/conf/httpd.conf ) and make sure that you have the line

    AddHandler application/x-httpd-php .php .php4 .php3

    Just before

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    If it is not there, add it..the resulting lines should be

    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    Now..restart apache...

    Hope..it may help someone...

  5. #5
    Member
    Join Date
    Mar 2004
    Posts
    710

    Default

    I had the same thing happen, and I had done the update from easyapache and then it did not work. As a fluke, I tried recompiling from Whm and it did. No idea why, as I retried that as as fluke as easyapche also did not give me any options to upgrade php to any 5.0, (I left at 4.42 anyway to check and see if all 5.x problems were solved with Cpanel yet. I think so, but...)
    Lloyd F Tennison

  6. #6
    sag
    sag is offline
    Registered User
    Join Date
    Aug 2006
    Posts
    1

    Default

    Yes! It worked :-)
    AddHandler application/x-httpd-php .php .php4 .php3 was missing after enabling suexec.

    Thanks for your post.

    Quote Originally Posted by Renjith Rajan
    Its an old thread..still i am posting the solution...

    Problem:-

    After compiling phpsuexec you are getting 500 errors when accessing php files...

    apache error_log shows

    Premature end of script headers: /home/xxxx/public_html/index.php

    suexec_log shows

    info: (target/actual) uid: (xxxx/xxxx) gid: (xxxx/xxxx) cmd: index.php
    error: file has no execute permission: (/home/xxxx/public_html/index.php)

    Solution:-

    Check httpd.conf (/usr/local/apache/conf/httpd.conf ) and make sure that you have the line

    AddHandler application/x-httpd-php .php .php4 .php3

    Just before

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    If it is not there, add it..the resulting lines should be

    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    Now..restart apache...

    Hope..it may help someone...

  7. #7
    Member
    Join Date
    Apr 2003
    Posts
    193

    Thumbs up

    Tought and Good call!!!


    Way to go Renjith Rajan!

  8. #8
    Member
    Join Date
    Aug 2007
    Posts
    7

    Default

    I just go this error after upgrading to Apache 1.3.39 + PHP 5.2.4 with phpSuExec and solved adding the missing "AddHandler" directive.

    Although almost a year has passed, I would like to thank you for your solution.

  9. #9
    big
    big is offline
    Member
    Join Date
    Aug 2001
    Location
    Earth
    Posts
    232

    Default

    mine is
    Code:
        #
        # AddHandler allows you to map certain file extensions to "handlers",
        # actions unrelated to filetype. These can be either built into the server
        # or added with the Action command (see below)
        #
        # If you want to use server side includes, or CGI outside
        # ScriptAliased directories, uncomment the following lines.
        #
        # To use CGI scripts:
        #
    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml
    AddHandler cgi-script .cgi .pl
    AddType text/html .shtml
    AddType application/x-tar .tgz
    AddType text/vnd.wap.wml .wml
    AddType image/vnd.wap.wbmp .wbmp
    AddType text/vnd.wap.wmlscript .wmls
    AddType application/vnd.wap.wmlc .wmlc
    AddType application/vnd.wap.wmlscriptc .wmlsc
    and yet having this error? any other solution?

  10. #10
    Member
    Join Date
    Nov 2003
    Posts
    119

    Default

    Quote Originally Posted by big View Post
    mine is
    Code:
        #
        # AddHandler allows you to map certain file extensions to "handlers",
        # actions unrelated to filetype. These can be either built into the server
        # or added with the Action command (see below)
        #
        # If you want to use server side includes, or CGI outside
        # ScriptAliased directories, uncomment the following lines.
        #
        # To use CGI scripts:
        #
    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml
    AddHandler cgi-script .cgi .pl
    AddType text/html .shtml
    AddType application/x-tar .tgz
    AddType text/vnd.wap.wml .wml
    AddType image/vnd.wap.wbmp .wbmp
    AddType text/vnd.wap.wmlscript .wmls
    AddType application/vnd.wap.wmlc .wmlc
    AddType application/vnd.wap.wmlscriptc .wmlsc
    and yet having this error? any other solution?
    Chmod -R 755 *.php on the affected site, worked for me. (checked one of the users scripts and it was set to 777 ) changed it and voilla fixed

  11. #11
    big
    big is offline
    Member
    Join Date
    Aug 2001
    Location
    Earth
    Posts
    232

    Default

    mine was fixed by removing APC because it doesn't work with phpsuexec

  12. #12
    Member
    Join Date
    Aug 2007
    Posts
    53

    Default

    YOU JUST SAVED MY ASS!

    Ok ok, sorry about the caps, but I owe you a lifetime of beer. Thanks.



    Quote Originally Posted by Renjith Rajan View Post
    Its an old thread..still i am posting the solution...

    Problem:-

    After compiling phpsuexec you are getting 500 errors when accessing php files...

    apache error_log shows

    Premature end of script headers: /home/xxxx/public_html/index.php

    suexec_log shows

    info: (target/actual) uid: (xxxx/xxxx) gid: (xxxx/xxxx) cmd: index.php
    error: file has no execute permission: (/home/xxxx/public_html/index.php)

    Solution:-

    Check httpd.conf (/usr/local/apache/conf/httpd.conf ) and make sure that you have the line

    AddHandler application/x-httpd-php .php .php4 .php3

    Just before

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    If it is not there, add it..the resulting lines should be

    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    Now..restart apache...

    Hope..it may help someone...

Similar Threads & Tags
Similar threads

  1. Replies: 5
    Last Post: 12-22-2010, 04:44 PM
  2. Replies: 4
    Last Post: 12-15-2007, 03:26 PM
  3. apache + php suexec in cpanel
    By gimmereeson in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-18-2007, 12:39 PM
  4. apache php suexec
    By Mykul31217 in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 06-20-2007, 09:36 AM
  5. PHP, SuExec, FastCGI and Apache 1.3.x
    By asterisk in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-02-2006, 11:10 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube