Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 5:50 AM, Richard Quadling wrote:


2009/7/6 Jeff Weinberger j...@jeffweinberger.com:

Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving
thousands of log messages of the form PHP Deprecated: 

I know I have a number of scripts that use now-deprecated  
functions, etc.

and I now know what those are, thanks to all the messages.

However, this is now growing to (literally) gigabytes of log  
entries, so I'd

like to stop the messages until I have the time to re-write all the
offending scripts.

I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING   
E_PARSE 
E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE 

E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING   
E_PARSE 
E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE 

E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE 
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR   
E_COMPILE_ERROR 

E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR   
E_USER_ERROR 

E_COMPILE_ERROR  E_COMPILE_WARNING

(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...  
messages.


System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a  
CGI
under Apache 2.2.11 and as a CLI. Please let me know if there's any  
other

info that might help.

php_info() reports error.reporting as 0

Any help or guidance is appreciated!!

Thanks,

--Jeff



No one ever achieved greatness by playing it safe. -Harry Gray


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Try ...

error_reporting = 22527


--
-
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
Standing on the shoulders of some very clever giants!
I need a car : http://snipurl.com/l4pih
ZOPA : http://uk.zopa.com/member/RQuadling


Richard (and Tom):

This seemed like it would be the perfect solution...but alas it did  
not work. 22527 seems right, but after changing php.ini to that and  
restarting php and apache, I am still getting Deprecated... messages.


:(

I'll keep trying...and any other suggestions are much appreciated!

Thanks!




A wise man will make more opportunities than he finds. -Francis Bacon


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote:

On Tue, Jul 7, 2009 at 11:03, Jeff  
Weinbergerj...@jeffweinberger.com wrote:


This seemed like it would be the perfect solution...but alas it did  
not
work. 22527 seems right, but after changing php.ini to that and  
restarting

php and apache, I am still getting Deprecated... messages.


   Dumb question, Jeff: are you sure you're editing the correct  
php.ini file?


--
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Daniel:

Not a dumb question at all! I check every time (php_info()) to make  
sure the loaded configuration file is the one I'm editing. So, as  
far as I can tell, yes.


Should I be looking at something else to be sure?

Thanks!

--Jeff







UNIX is the Klingon of cyberspace. -from The Cluetrain Manifesto


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-07 Thread Jeff Weinberger

On Jul 7, 2009, at 12:30 PM, Tom Worster wrote:


On 7/7/09 12:17 PM, Jeff Weinberger j...@jeffweinberger.com wrote:


On Jul 7, 2009, at 8:38 AM, Daniel Brown wrote:


On Tue, Jul 7, 2009 at 11:03, Jeff
Weinbergerj...@jeffweinberger.com wrote:


This seemed like it would be the perfect solution...but alas it did
not
work. 22527 seems right, but after changing php.ini to that and
restarting
php and apache, I am still getting Deprecated... messages.


  Dumb question, Jeff: are you sure you're editing the correct
php.ini file?

--  
/Daniel P. Brown

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

--  
PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php


Daniel:

Not a dumb question at all! I check every time (php_info()) to make
sure the loaded configuration file is the one I'm editing. So, as
far as I can tell, yes.

Should I be looking at something else to be sure?


i've now had a look at http://www.php.net/manual/en/errorfunc.constants.php

in your shoes i'd try out 2047 (with is everything up to and including
E_USER_NOTICE) and possibly 6143 (=2047+4096) if you have your own  
error

handler.

if still no luck i can't think of anything else to suggest but work
backwards:

check the value returned by error_reporting() is the value you set in
php.ini.

binary decode it to double check.

if it sill makes no sense, check the php bugs db. and if nothing,  
maybe

report it.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Tom:

thanks - I'll try those and report back, and will keep playing with  
various combinations until I get it to work or prove it doesn't :)


One question - that I for some reason have not found - is there a list  
of the numerical values of the E_* constants somewhere?


Thanks for your help!

--Jeff







Real love is a pilgrimage. It happens when there is no strategy, but it is very 
rare because most people are strategists. -Anita Brookner


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-06 Thread Jeff Weinberger

Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving  
thousands of log messages of the form PHP Deprecated: 


I know I have a number of scripts that use now-deprecated functions,  
etc. and I now know what those are, thanks to all the messages.


However, this is now growing to (literally) gigabytes of log entries,  
so I'd like to stop the messages until I have the time to re-write all  
the offending scripts.


I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING   
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING


error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING   
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING   
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING


error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE   
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE   
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED


error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR   
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED


error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR   
E_USER_ERROR  E_COMPILE_ERROR  E_COMPILE_WARNING


(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...  
messages.


System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a  
CGI under Apache 2.2.11 and as a CLI. Please let me know if there's  
any other info that might help.


php_info() reports error.reporting as 0

Any help or guidance is appreciated!!

Thanks,

--Jeff



No one ever achieved greatness by playing it safe. -Harry Gray


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to stop E_DEPRECATED messages in the PHP log?

2009-07-06 Thread Jeff Weinberger

On Jul 6, 2009, at 7:47 PM, Paul M Foster wrote:


On Mon, Jul 06, 2009 at 02:16:09PM -0700, Jeff Weinberger wrote:


Hi:

I am hoping someone can help me figure this out

I've just upgraded my PHP installation to 5.3.0. Now I am receiving
thousands of log messages of the form PHP Deprecated: 

I know I have a number of scripts that use now-deprecated functions,
etc. and I now know what those are, thanks to all the messages.

However, this is now growing to (literally) gigabytes of log entries,
so I'd like to stop the messages until I have the time to re-write  
all

the offending scripts.

I have tried the following error.reporting lines in php.ini:

error_reporting = E_ALL  ~E_DEPRECATED  E_ERROR  E_WARNING 
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING 
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting = ~E_DEPRECATED  E_ALL  E_ERROR  E_WARNING 
E_PARSE  E_NOTICE  E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING 
E_USER_NOTICE  E_COMPILE_ERROR  E_COMPILE_WARNING

error_reporting =  E_ALL  E_ERROR  E_WARNING  E_PARSE  E_NOTICE 
E_CORE_ERROR  E_USER_ERROR  E_USER_WARNING  E_USER_NOTICE 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = E_ERROR  E_CORE_ERROR  E_USER_ERROR 
E_COMPILE_ERROR  E_COMPILE_WARNING  ~E_DEPRECATED

error_reporting = ~E_DEPRECATED  E_ERROR  E_CORE_ERROR 
E_USER_ERROR  E_COMPILE_ERROR  E_COMPILE_WARNING

(as you can tell, I prefer verbose logs, but not that verbose...).

None of these combinations have stopped the  PHP Deprecated: ...
messages.

System info: Mac OS/X 10.5.7 Client version, PHP 5.3.0 running as a
CGI under Apache 2.2.11 and as a CLI. Please let me know if there's
any other info that might help.

php_info() reports error.reporting as 0

Any help or guidance is appreciated!!


Try

error_reporting(E_ALL ^ E_DEPRECATED);

See http://us2.php.net/manual/en/function.error-reporting.php for more
info and examples.

Paul

--
Paul M. Foster

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Paul:

Thanks for your suggestion - it would work nicely, except that that is  
a runtime function that is called within a script.


I am trying to get the php.ini setting correct to avoid the Deprecated  
messages.


I tried error_reporting=E_ALL  ~E_DEPRECATED (which I think is the  
php.ini analogy to your suggestion) to no avail - it failed also.


leaving me still confused

--Jeff



The achievements of an organization are the results of the combined effort of each 
individual. -Vincent Thomas Vince Lombardi


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP (under httpd) reading a file outside DocumentRoot?

2008-12-27 Thread Jeff Weinberger

On Dec 26, 2008, at 1:52 PM, Nathan Rixham wrote:


Jeff Weinberger wrote:
I don't know if this is an Apache (httpd) or a PHP issue (I suspect  
PHP, but I may be doing something wrong with mod_suexec), so I hope  
this is the right place to ask. I certainly appreciate any help  
anyone can offer!
I am trying to get a PHP script to read a file that's outside the  
DocumentRoot of a VirtualHost, in fact well outside the parent  
directory of all of my virtual hosts.
I have successfully managed to get Apache httpd to run the script  
as the correct user and group (matching the target file's  
ownership) using SuexecUserGroup. I tested this by having the  
script create/write a test file, which had owner and group set  
correctly.
However, when I run the script, at the file(/path/to/target/file)  
command, PHP tells me it can't open the file - permission is denied.

In php.ini safe_mode is off and open_basedir is not set.
I am not sure where else to look for a solution - any help is very  
much appreciated!
FYI: PHP 5.2.6, Apache httpd 2.2.11, mod_ssl/2.2.11, OpenSSL/0.9.7l  
on Mac OS/X 10.5.5. I'm reaching the script over an SSL (https)  
connection if that matters).

Thanks!


do what it takes to make it work (ie chmod 777 or similar) then put  
things back to how they presently are one by one to find the cause  
of the error. :)


Nathan: Thanks for your suggestion - a good debugging step - but the  
permissions on the file I want the script to read have been -rw-rw-rw-  
the entire time.


This leads me to suspect that the issue is not the permissions  
themselves, but rather something about my PHP configuration or script  
(or, possibly, as I noted, my Apache httpd configuration) that is  
causing PHP to report a permission error on reading the file.


I don't know where else to look for this issue, so I hope that someone  
has at least some pointers or suggestions on what might be happening  
here.


Thank you very much for any help!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP (under httpd) reading a file outside DocumentRoot?

2008-12-26 Thread Jeff Weinberger
I don't know if this is an Apache (httpd) or a PHP issue (I suspect  
PHP, but I may be doing something wrong with mod_suexec), so I hope  
this is the right place to ask. I certainly appreciate any help anyone  
can offer!


I am trying to get a PHP script to read a file that's outside the  
DocumentRoot of a VirtualHost, in fact well outside the parent  
directory of all of my virtual hosts.


I have successfully managed to get Apache httpd to run the script as  
the correct user and group (matching the target file's ownership)  
using SuexecUserGroup. I tested this by having the script create/write  
a test file, which had owner and group set correctly.


However, when I run the script, at the file(/path/to/target/file)  
command, PHP tells me it can't open the file - permission is denied.


In php.ini safe_mode is off and open_basedir is not set.

I am not sure where else to look for a solution - any help is very  
much appreciated!


FYI: PHP 5.2.6, Apache httpd 2.2.11, mod_ssl/2.2.11, OpenSSL/0.9.7l on  
Mac OS/X 10.5.5. I'm reaching the script over an SSL (https)  
connection if that matters).


Thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] noob need help for sessions

2005-04-07 Thread Jeff Weinberger
I'm having a similar problem with managing sessions without Cookies. I 
am also somewhat new to PHP, so I may be missing something here (if so, 
please point it out!).

I am well warned about the dangers of passing session IDs in URLs, but 
for my purposes, there is no sensitive data in the session, and I want 
to be able to do it only in the case where the visitor does not accept 
cookies.

I also have a related question below.
I have these two files, just to test:
page1.php:
?php
session_start();
session_register(abc);
$abc = Test Session String;
print 'a href=page2.php?'.SID.'page 2/a';
?
page2.php:
?php
session_start();
session_id(strip_tags($_GET['PHPSESSID'])); //I've tried it without 
this statement also...
print $abc;
?

The result is always that $abc is undefined on page 2. The session file 
gets created on my server, and had the proper data.

I have tried a number of combinations of these statements based on what 
I've read in the on-line documentation (on php.net), but I'm lost as to 
how do get the session data to cross pages.

Any help or direction (especially with examples!) is much appreciated.
Next (and hopefully related) question:
One thing I'd like to do here is to pass the session via the URL ONLY 
in the case where the visitor has set their browser not to accept 
cookies (or for whatever reason, the PHPSESSID cookie does not get 
set).

I can test in every page at the point where I insert the ?SID into the 
URL. But will that work on the first page the visitor visits?

In other words, in my initial page (index.php) which has a 
session_start(); at the top, will $_cookie['phpsessid'] be set 
immediately? I assume based on the documentation, that is it only set 
when the cookie exists at the time the page is loaded?

Is there another way to test to see if the PHPSESSID cookie was set at 
(or soon after) session_start() and on the same page and in the same 
script?

I'd prefer to avoid creating an index.php page that only sets a cookie 
(or starts a session) and immediately redirects to another page just to 
get around this problem

Thank you very much for your help!!
--Jeff

On Wed, April 6, 2005 1:59 am, [EMAIL PROTECTED] said:
I'm having problem with my session, when I login my session is 
registered
ok but
when I click on another page it's canceled again.
I use that kind of link:
index.php?menu=voyage#038;sid=$sess_id

then on top of the page I use:
if(session_id()){
session_id(strip_tags($_GET['sid']));
session_start();
This only starts a session if you have session_id (above) which only
happens if you already started a session...
Perhaps you meant:  if (!session_id()) above.
More likely, you don't need any of these 4 or 5 lines of code except:
session_start();
PHP manages the session ID for you just fine, for almost all uses.
 $sess_id = session_id();
 $nom_user = $_SESSION['session_nom'];
 $prenom_user = $_SESSION['session_prenom'];
$bienvenue=Bienvenue $prenom_user $nom_user;
}
 http://81.57.4.105/~pat/alliance/  (user and pass = admin) can 
someone
tell me
how when I click on the top boxes link the session is not kept? here 
is
the
code: http://hashphp.org/pastebin?pid=2354

thanx in advance
Pat
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php