470,833 Members | 1,620 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

PHP safe_mode sometimes appears to be on?

I have just upgraded a web server to use apache 1.3.29 with php 4.3.4.
Since this upgrade (from php 4.1.1) a number of our PHP paes have come up
with errors complaining that safe mode is in operation and that as UIDs
don't match the page cannot be served.

Safe mode is NOT switched on globally either in php.ini or in the
httpd.conf file for that part of the web site. The only place we use safe
mode is in a different virtual host where staff and students are able to
create their own pages. Not only that, if you refresh the offending page
in the browser, the page is usually served correctly without errors. I
have emptied my browser cache but this makes no difference, the problem
still occurs from time to time.

Has anyone else seen this strange behaviour? Have you any suggestions
what to look for?

Chris Ritson
Jul 17 '05 #1
2 1583
I had a weird problem with php that I fixed by recompiling it with no
optimization. I am compiling with gcc 3.3.1. Normally I compile with
-O3. I had to compile with -O0 (no optimization) and then my problem
went away. Something you could possibly try.

Chris Ritson <C.********@ncl.ac.uk> writes:
I have just upgraded a web server to use apache 1.3.29 with php 4.3.4.
Since this upgrade (from php 4.1.1) a number of our PHP paes have come up
with errors complaining that safe mode is in operation and that as UIDs
don't match the page cannot be served.

Safe mode is NOT switched on globally either in php.ini or in the
httpd.conf file for that part of the web site. The only place we use safe
mode is in a different virtual host where staff and students are able to
create their own pages. Not only that, if you refresh the offending page
in the browser, the page is usually served correctly without errors. I
have emptied my browser cache but this makes no difference, the problem
still occurs from time to time.

Has anyone else seen this strange behaviour? Have you any suggestions
what to look for?

Chris Ritson

Jul 17 '05 #2
Chris Ritson <C.********@ncl.ac.uk> wrote in
news:Xn*****************************@128.240.233.5 5:
I have just upgraded a web server to use apache 1.3.29 with php
4.3.4. Since this upgrade (from php 4.1.1) a number of our PHP paes
have come up with errors complaining that safe mode is in operation
and that as UIDs don't match the page cannot be served.

Safe mode is NOT switched on globally either in php.ini or in the
httpd.conf file for that part of the web site. The only place we use
safe mode is in a different virtual host ...
Not only that, if you refresh
the offending page in the browser, the page is usually served
correctly without errors.


I have now found what appears to be a work-around for this. As stated,
safe mode is switched off globally in php.ini. Although it should have
no effect, adding:-

php_admin_flag safe_mode off

to my <Directory /> </Directory> entry in httpd.conf has prevented the
problem occuring. I have no proof, but my guess is that if one of the
httpd worker processes has processed a request in safe mode, the
default setting is not returned to its value from php.ini when the next
request is processed. When I get a chance on a test server, I will
upgrade to the latest versions of httpd 1 and php 4 and if the problem
still occurs, I will report a bug.

Chris Ritson.
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Henrik Oddershede | last post: by
reply views Thread by Gerrit Kuilder | last post: by
1 post views Thread by David Ruiz | last post: by
2 posts views Thread by Salmo Bytes | last post: by
1 post views Thread by Felix Natter | last post: by
2 posts views Thread by ZMAN | last post: by
1 post views Thread by ramc18 | last post: by
reply views Thread by Zeilkman | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.