php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12691 Apache 2: Server variables don't get set
Submitted: 2001-08-10 10:42 UTC Modified: 2002-02-15 21:50 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:1 (20.0%)
From: teo at gecadsoftware dot com Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.1.1 OS: SuSE7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 + 12 = ?
Subscribe to this entry?

 
 [2001-08-10 10:42 UTC] teo at gecadsoftware dot com
Apache 2.0.24-dev
PHP4-200108091635

CFLAGS='-O6 -fomit-frame-pointer' \
'./configure' \                                                                                                                                        
'--with-apxs2=/usr/local/apache2/bin/apxs' \                                                                                                           
'--with-mysql' \                                                                                                                                       
'--disable-posix' \                                                                                                                                    
'--disable-pic' \                                                                                                                                      
'--with-zlib' \                                                                                                                                        
'--enable-wddx' \

Looks like PHP doesn't import SERVER_* environment variables:
e.g.
<?php print getenv('SERVER_NAME')?>
or
<?php print $_SERVER['SERVER_NAME']?>

yeilds nothin'

-- tedor

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-10 10:49 UTC] alindeman@php.net
works fine for me (Apache 1.3.20 + PHP Latest CVS).

Try running <?phpinfo()?> and see what variables are defined..
 [2001-08-10 11:08 UTC] teo at gecadsoftware dot com
hi alindeman,

erm, you missed the essential "2" :)
it's with Apache2 (apxs2)

Additional note:
 printenv from /cgi-bin shows them just right.

 [2001-11-03 21:53 UTC] sniper@php.net
updated short desc.

 [2001-11-17 12:10 UTC] mj@php.net
There has been a patch regarding this three days ago. Please try the latest snapshot from http://snaps.php.net/ and report, if the problem still comes up.
 [2001-11-19 12:37 UTC] teo at gecadsoftware dot com
ok, here's what I tried:

o PHP4.0.2-dev (php4-200111190000 from snaps)
o config line is:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-dom' '--disable-posix' '--disable-pic' '--with-zlib' '--enable-wddx'

o Apache2.0.28-beta
o config line is:
CFLAGS="-g"; export CFLAGS
"./configure" \
"--enable-layout=Apache" \
"--enable-auth-digest" \
"--enable-ext-filter" \
"--disable-include" \
"--enable-headers" \
"--enable-so" \
"--enable-ssl=shared" \
"--with-mpm=threaded" \
"--enable-http" \
"--enable-dav=shared" \
"--disable-asis" \
"--enable-info=shared" \
"--enable-suexec" \
"--enable-cgi=shared" \
"--enable-cgid=shared" \
"--enable-dav-fs=shared" \
"--enable-vhost-alias=shared" \
"--disable-imap" \
"--enable-rewrite=shared" \
"--with-suexec-uidmin=30" \
"--with-suexec-gidmin=65534" 

Now env vars are set ok (either with or without seting I/O filters, just with an AddType), *BUT* :) I still found that one very important one is missing, namely PATH_INFO.

If I say http://teo.gecadsoftware.com/i.php/x it gives a file not found error (where i.php exists and contains a phpinfo() call).

I tried to catch that with FilesMatch, but couldn't figure (I think the test for $DOCUMENT_ROOT/i.php/x to exist is done before applying matches, which makes sense).

I am having a look into it but my experience with Apache2 is  less that epsilon :) so maybe somebody can have a look too?
 [2002-01-09 10:12 UTC] skip1952 at yahoo dot com
I am seeing the same problem with Apache 2.0.28, php 4.1.1 under RedHat Linux

When I run phpinfo() all the environmental variables are missing compared to running phpinfo() with Apache 1.3.22 and php 4.1.1
 [2002-02-15 21:50 UTC] yohgaki@php.net
This bug has been fixed in CVS.

This bug has been fixed in CVS.

This bug has been fixed in CVS.

This bug has been fixed in CVS.

I don't have problem with CVS version. Reopen if you have problem still with CVS version
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC