You are not logged in.

#1 2014-07-04 17:39:26

AGT
Member
From: Null Void
Registered: 2012-10-27
Posts: 58
Website

Solved: SUPHP: Not Working

This isn't necessarily related to AUR.

I'm trying to install and to use SUPHP, but I am unsuccessful.

I have tried versions 0.7.2, 0.7.1, and 0.7.0.

First of all, running ./configure with versions 0.7.2 and 0.7.1, results, at the end, with:

configure: WARNING: unrecognized options: --disable-checkuid, --disable-checkgid

This would not be necessarily a problem, as it is only a warning, but I need to use these options. They work in version 0.7.0, but I want to use the latest version.
This post is relevant for version 0.7.2.

These are the commands that I used to install it:

autoreconf -if
./configure --with-min-uid=0 --with-min-gid=0 --with-apache-user=http --with-logfile=/var/log/httpd/suphp.log --disable-checkpath --disable-checkuid --disable-checkgid --with-setid-mode=owner --with-apr=/usr/bin/apr-1-config
# https://bbs.archlinux.org/viewtopic.php?id=156866
# In "src/Makefile"
# Modify:
# MAYBE_AP = apache
# #MAYBE_AP = apache2
# Set it to:
# #MAYBE_AP = apache
# MAYBE_AP = apache2
sed --in-place --regexp-extended '/^[[:blank:]]*MAYBE_AP[[:blank:]]*=[[:blank:]]*apache[[:blank:]]*$/s/^/#/; /^[[:blank:]]*#[[:blank:]]*MAYBE_AP[[:blank:]]*=[[:blank:]]*apache2[[:blank:]]*$/s/^#//' src/Makefile
make CFLAGS+=-I/usr/include/apr-1/
make install
make installcheck

When I try running a PHP script, this error occurs in Apache's log:

SecurityException in Application.cpp:181: Do not have root privileges. Executable not set-uid root?

I tried:

chmod u+s $(which suphp)

Recommended from http://kb.gosi.at/content/28/71/en/how- … -root.html and from http://enlook.wordpress.com/2013/07/17/ … -uid-root/, but it didn't solve the problem.

I installed the OS a few days ago. I have another machine, where the OS was installed much longer ago, with the same settings, and SUPHP works.

Finally, here is my configuration:

# /etc/httpd/conf/extra/suphp.conf

<IfModule suphp_module>
	suPHP_Engine on
	suPHP_AddHandler application/x-httpd-php
	
	<FilesMatch "\.php$">
		SetHandler application/x-httpd-php
	</FilesMatch>
	
	<FilesMatch "\.phps$">
		SetHandler application/x-httpd-php-source
	</FilesMatch>
 </IfModule>
# /etc/suphp/suphp.conf

[global]
;Path to logfile
logfile=/var/log/httpd/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=http

;Path all scripts have to be in
;docroot=/var/www:${HOME}/public_html:/srv/http
docroot=/

;Path to chroot() to before executing script
;chroot=/mychroot

; Security options
allow_file_group_writeable=true
allow_file_others_writeable=true
allow_directory_group_writeable=true
allow_directory_others_writeable=true

;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=false

;PATH environment variable
env_path=/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/vendor_perl:/usr/bin/core_perl

;Umask to set, specify in octal notation
umask=0022

; Minimum UID
min_uid=0

; Minimum GID
min_gid=0


[handlers]
;Handler for php-scripts
application/x-httpd-php="php:/usr/bin/php-cgi"

;Handler for CGI-scripts
application/x-suphp-cgi="execute:!self"

And

> stat -c %a:%u:%g $(which suphp)
4755:0:0

What could the problem be? How could it be resolved?
Thank you.

Last edited by AGT (2014-07-08 14:59:11)

Offline

#2 2014-07-08 14:57:39

AGT
Member
From: Null Void
Registered: 2012-10-27
Posts: 58
Website

Re: Solved: SUPHP: Not Working

I solved the problem:

The root FS volume was mounted with the option "nosuid".
Removing it, or changing it to "suid" solved it.

I remounted the volume to apply the option: "mount -o remount,suid,dev,relatime,attr2,inode64,sunit=8,swidth=16,noquota /".

Offline

Board footer

Powered by FluxBB