Re: [PHP]How to handle E_ERROR,E_PARSE with a user defined function

2012-05-23 Thread Yuchen Wang
Thank you

I finally found a method to process these errors that using
register_shutdown_function()
You can read it from this  http://insomanic.me.uk/post/229851073  or
http://mo47.com/blog/2012/catching-fatal-errors

2012/5/23 ma...@behnke.biz ma...@behnke.biz

   -Original Message-
  From: Yuchen Wang [mailto:phob...@gmail.com]
  Sent: Tuesday, May 22, 2012 10:19 PM
  To: php-general Maillist
  Subject: [PHP]How to handle E_ERROR,E_PARSE with a user defined function
 
  Hi all,
 
  How to handle E_ERROR,E_PARSE with a user defined function ?

 Aren't these startup errors? I am not quite sure, but if the y can't be
 handled with php.

 This is from the PHP docs

 The following error types cannot be handled with a user defined function:
 E_ERROR , E_PARSE , E_CORE_ERROR , E_CORE_WARNING , E_COMPILE_ERROR ,
 E_COMPILE_WARNING , and most of E_STRICT raised in the file where
 set_error_handler() is called.
 If errors occur before the script is executed (e.g. on file uploads) the
 custom error handler cannot be called since it is not registered at that
 time.

 So the only thing you can do is have a watchdog on your phperror.log  and
 dosomething if these errors occur.

 To preparse syntax errors you can use find and php -l

 $ find . -name *.php -exec php -l {} \;
 No syntax errors detected in ./bootstrap.php
 No syntax errors detected in ./htdocs/index.php
 No syntax errors detected in ./templates/comment.php
 No syntax errors detected in ./templates/postform.php
 No syntax errors detected in ./templates/blog.php
 No syntax errors detected in ./templates/main.php
 No syntax errors detected in ./templates/error.php
 No syntax errors detected in ./templates/commentform.php
 No syntax errors detected in ./templates/post.php
 No syntax errors detected in ./classes/rendering/View.php
 No syntax errors detected in ./classes/storage/SqliteStorage.php
 No syntax errors detected in ./classes/storage/Storage.php
 No syntax errors detected in ./classes/models/Blog.php
 No syntax errors detected in ./classes/models/Comment.php
 No syntax errors detected in ./classes/models/Post.php
 No syntax errors detected in ./classes/models/Model.php
 No syntax errors detected in ./classes/helper/HTMLResult.php
 No syntax errors detected in ./classes/helper/Result.php
 No syntax errors detected in ./classes/helper/ApplicationConfig.php
 No syntax errors detected in ./classes/helper/ErrorHandler.php
 No syntax errors detected in ./classes/helper/Request.php
 No syntax errors detected in ./classes/helper/ExceptionHandler.php
 No syntax errors detected in ./classes/helper/JSONResult.php
 No syntax errors detected in ./classes/app/Router.php
 No syntax errors detected in ./classes/controller/BlogController.php
 No syntax errors detected in ./classes/controller/Controller.php




-- 
*Yuchen Wang*


[PHP]How to handle E_ERROR,E_PARSE with a user defined function

2012-05-22 Thread Yuchen Wang
Hi all,

How to handle E_ERROR,E_PARSE with a user defined function ?

-- 
*Yuchen Wang*


[PHP] problem about PHP-FPM in TCP socket and Unix socket

2012-03-02 Thread Yuchen Wang
Hello all,

I am trying to config some new server

All of my servers are using TCP Socket(127.0.0.1:9000) between nginx and
php-fpm before

But, I run ab(ab -n 2 -c50 http://192.168.74.130:81/) to test the
performance of Unix Socket and TCP Socket,
the result is Unix is little better than TCP

Usually we run php and web server in the same server,
So, TCP socket and Unix socket
Which method do you prefer ?

Thank you

-- 
*Yuchen Wang*