Apache, php and suexec problem... URGENT

KimBO

Well-Known Member
Sep 2, 2004
69
0
156
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
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
KimBO said:
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?
 

Renjith Rajan

Member
Aug 22, 2004
17
0
151
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...
 

lloyd_tennison

Well-Known Member
Mar 12, 2004
697
1
168
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...)
 

sag

Registered
Aug 4, 2006
1
0
151
Yes! It worked :)
AddHandler application/x-httpd-php .php .php4 .php3 was missing after enabling suexec.

Thanks for your post.

Renjith Rajan said:
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...
 

Sindorf

Member
Aug 3, 2007
7
0
51
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. :)
 

big

Well-Known Member
Aug 12, 2001
224
0
316
Earth
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?
 

dragon2611

Well-Known Member
Nov 30, 2003
124
0
166
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 :eek: ) changed it and voilla fixed :D
 

nerbonne

Well-Known Member
Aug 19, 2007
52
1
58
YOU JUST SAVED MY ASS!

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



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...