By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,047 Members | 1,257 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,047 IT Pros & Developers. It's quick & easy.

PHP safe_mode sometimes appears to be on?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.