php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38807 PHP 4.4.4 does ignore the SetEnv PHPRC with suPHP (PHP4 only)
Submitted: 2006-09-13 14:27 UTC Modified: 2007-02-05 18:25 UTC
From: gregory dot agerba at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.4 OS: CentOS/Fedora/Debian
Private report: No CVE-ID:
 [2006-09-13 14:27 UTC] gregory dot agerba at gmail dot com
Description:
------------
Hello,

I can see that since the upgrade to PHP 4.4.4, it is no more possible to handle php.ini user's file.

We do have Fedora Core 5, CentOS 4.3, and Debian 3.1.

Example :

suPHP_Engine   on
<Files ~ "\.php5$">
    SetEnv PHPRC /some/where/config/php5
</Files>

<Files ~ "\.(php|php3|php4?)$">
    SetEnv PHPRC /some/where/config/php4
</Files>

It does not work with PHP 4.4.4 (and even if I roll back to 4.4.3 the problem persist).

It works fine with PHP 5.1.6.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-13 14:37 UTC] tony2001@php.net
What do you see with var_dump(getenv("PHPRC")); (using the same PHP instance)?
 [2006-09-13 14:56 UTC] gregory dot agerba at gmail dot com
Hello,

I get this as the result :

string(53) "/usr/local/directadmin/data/users/chmod64/config/php4" 

This is the correct path to my php.ini file. I have tried, the file exist and have the correct chmod. 

The most strange is that with PHP5 it works fine.

[root@web01 public_html]# ll /usr/local/directadmin/data/users/chmod64/config/php4
total 8
-rwxr-xr-x 1 root root 6754 Sep 13 16:34 php.ini

I will give you all my configuration files.

VIRTUALHOST
===========

<VirtualHost SERVERIP:80>

        ServerName www.mydomain.net
        ServerAdmin webmaster@mydomain.net
        DocumentRoot /home/chmod64/domains/mydomain.net/public_html


        UseCanonicalName OFF

        User chmod64
        Group chmod64

        suPHP_Engine on

        <Files ~ "\.php5$">
                SetEnv PHPRC /usr/local/directadmin/data/users/chmod64/config/php5
        </Files>

        <Files ~ "\.(php|php3|php4?)$">
                SetEnv PHPRC /usr/local/directadmin/data/users/chmod64/config/php4
        </Files>

        CustomLog /var/log/httpd/domains/mydomain.net.bytes bytes
        CustomLog /var/log/httpd/domains/mydomain.net.log combined
        ErrorLog /var/log/httpd/domains/mydomain.net.error.log

        <Directory /home/chmod64/domains/mydomain.net/public_html>
                Options +Includes -Indexes
        </Directory>


</VirtualHost>

PHP CONFIGURATION FILE FOR PHP4
===============================

N.B. I have early the same for PHP5, I just changed the reference from PHP4 to PHP5 inside my file, to be able to later make the changes.

[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision =  12
y2k_compliance = On
output_buffering = 4096
;output_handler =
;zlib.output_compression = Off
;zlib.output_handler =
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = On
memory_limit = 20M

safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =						
safe_mode_exec_dir =

safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
open_basedir = "/home/chmod64/:/usr/local/php4/lib/php/:/var/www/html:/usr/local/directadmin/data/skins/:/tmp"
disable_functions = "ini_restore, sscanf, tempnam, copy, popen , pclose, system, setlimit, exec, shell_exec, suExec, dl, passthru, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, pfsockopen, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg"
disable_classes =

;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

expose_php = Off

error_reporting  =  E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = On
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = Off
;docref_root = "/phpmanual"
;docref_ext = .html
;error_prepend_string = "<font color=ff0000>"
;error_append_string = "</font>"
;error_log = /home/chmod64/tmp/error_log

;arg_separator.output = "&amp;"
;arg_separator.input = ";&"
variables_order = "GPCS"

register_globals = On
register_argc_argv = On
post_max_size = 32M
gpc_order = "GPC"

magic_quotes_gpc = On
magic_quotes_runtime = Off    
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =

default_mimetype = "text/html"
;default_charset = "iso-8859-1"
;always_populate_raw_post_data = On

include_path = ".:/usr/local/php4/lib/php/"

doc_root =
user_dir =
extension_dir = "./"
enable_dl = Off

;cgi.rfc2616_headers = 0 

file_uploads = On
upload_tmp_dir = "/home/chmod64/tmp"
upload_max_filesize = 24M

allow_url_fopen = Off
from="chmod64@chmod644.net"
agent="PHP at chmod644.net"
default_socket_timeout = 60

[Syslog]
define_syslog_variables  = Off

[mail function]
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i -f chmod64@chmod644.net

[Java]
;java.class.path = .\php_java.jar
;java.home = c:\jdk
;java.library = c:\jdk\jre\bin\hotspot\jvm.dll 
;java.library.path = .\

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db    =  Not yet implemented
;odbc.default_user  =  Not yet implemented
;odbc.default_pw    =  Not yet implemented
odbc.allow_persistent = Off
odbc.check_persistent = On
odbc.max_persistent = 0
odbc.max_links = 3  
odbc.defaultlrl = 4096  
odbc.defaultbinmode = 1  

[MySQL]
mysql.allow_persistent = Off
mysql.max_persistent = 0
mysql.max_links = 4
mysql.default_port = 3306
mysql.default_socket = /var/lib/mysql/mysql.sock
mysql.default_host = localhost
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 30
mysql.trace_mode = Off

[mSQL]
msql.allow_persistent = Off
msql.max_persistent = 0
msql.max_links = 4

[PostgresSQL]
pgsql.allow_persistent = Off
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = 0
pgsql.max_links = 4
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase]
sybase.allow_persistent = Off
sybase.max_persistent = 0
sybase.max_links = 4
;sybase.interface_file = "/usr/sybase/interfaces"
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off

[Sybase-CT]
sybct.allow_persistent = Off
sybct.max_persistent = 0
sybct.max_links = 4
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[dbx]
dbx.colnames_case = "lowercase"

[bcmath]
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = Off
ifx.max_persistent = 0
ifx.max_links = 4
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0

[Session]
session.save_handler = files
session.save_path = /home/chmod64/tmp/sessions
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor     = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
mssql.allow_persistent = Off
mssql.max_persistent = 0
mssql.max_links = 4
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
;mssql.connect_timeout = 5
;mssql.timeout = 60
;mssql.textlimit = 4096
;mssql.textsize = 4096
;mssql.batchsize = 0
;mssql.datetimeconvert = On
mssql.secure_connection = Off
;mssql.max_procs = 25

[Assertion]
;assert.active = On
;assert.warning = On
;assert.bail = Off
;assert.callback = 0
;assert.quiet_eval = 0

[Ingres II]
ingres.allow_persistent = Off
ingres.max_persistent = 0
ingres.max_links = 4
ingres.default_database =
ingres.default_user =
ingres.default_password =

[Verisign Payflow Pro]
pfpro.defaulthost = "test-payflow.verisign.com"
pfpro.defaultport = 443
pfpro.defaulttimeout = 30
;pfpro.proxyaddress =
;pfpro.proxyport =
;pfpro.proxylogon =
;pfpro.proxypassword =

[Sockets]
sockets.use_system_read = On

[com]
;com.typelib_file = 
;com.allow_dcom = true
;com.autoregister_typelib = true
;com.autoregister_casesensitive = false
;com.autoregister_verbose = true

[Printer]
;printer.default_printer = ""

[mbstring]
;mbstring.language = Japanese
;mbstring.internal_encoding = EUC-JP
;mbstring.http_input = auto
;mbstring.http_output = SJIS
;mbstring.encoding_translation = Off
;mbstring.detect_order = auto
;mbstring.substitute_character = none;
;mbstring.func_overload = 0

[FrontBase]
;fbsql.allow_persistent = Off
;fbsql.autocommit = On
;fbsql.default_database = 
;fbsql.default_database_password =
;fbsql.default_host =
;fbsql.default_password =
;fbsql.default_user = "_SYSTEM"
;fbsql.generate_warnings = Off
;fbsql.max_connections = 128
;fbsql.max_links = 3
;fbsql.max_persistent = 0
;fbsql.max_results = 128
;fbsql.batchSize = 1000

[Crack]

[exif]
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel    = UCS-2LE
;exif.encode_jis = 
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel    = JIS
 [2007-02-05 18:23 UTC] gregory dot agerba at gmail dot com
Hello,

This issue has been solved after upgradig to suPHP 0.6.2.

Thank you.

Gregory
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 20:02:01 2014 UTC