php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #62894 add preloaded binaries function for APC
Submitted: 2012-08-22 13:22 UTC Modified: 2016-11-18 21:24 UTC
From: cfc4n at cnxct dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.16 OS: ubuntu 12.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cfc4n at cnxct dot com
New email:
PHP Version: OS:

 

 [2012-08-22 13:22 UTC] cfc4n at cnxct dot com
Description:
------------
In my work,I need a function of apc to auto-load binary file. 

This binary file is dump of apc_bin_dump/apc_bin_dumpfile function. Because I 
want protect our php script source code. So I dump some of them to a binary 
file,and clear them scripts empty. 

I copy the binary file and empty php scripts file to an other server.  I must 
request a URI  to load binary file  use apc_bin_loadfile function when I use 
them.

If php-fpm restart and call apc_clear_cache ,I must request the URI one by one 
...
If there are some php-fpm master process , I not sure who is I request one...
If I have some server... 
It's too hard to operation and maintenance.


So, I have this idea. pre-load binary file when php-fpm start and after 
apc_clear_cache called.

I talked  with laruence ( http://pecl.php.net/user/laruence ) about this 
idea,He believes that this way is feasible. and I wish PHP Group can accept 
it.Thanks.

Test script:
---------------
dump script : 

https://github.com/cfc4n/cnxct/blob/master/apc_dump.php


patch :
https://github.com/cfc4n/cnxct/blob/master/apc_r327151_add_preload_binfile.patch

Expected result:
----------------
accept it.


Patches

add-preload-binary-file-function-to-apc-r327454 (last revision 2012-09-06 11:35 UTC by cfc4n at cnxct dot com)
add-preload-binary-file-function-to-apc (last revision 2012-08-22 13:25 UTC by cfc4n at cnxct dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-06 11:34 UTC] cfc4n at cnxct dot com
There are many faults in previous path.Bin file will loaded multiple times(as num 
of fpm subprocess)when use php-fpm. So I give a new method to achieve it. That is 
storing an identifier in share memory identify whether loaded. If do that in 
PHP_MINIT_FUNCTION , It will not autoload when apc_clear_cache function called. 
So,I think this is a very appropriate way to achieve it.
and patch 
:https://github.com/cfc4n/cnxct/blob/master/apc_r327454_add_preload_binfile.patch
 [2016-11-18 21:24 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-11-18 21:24 UTC] kalle@php.net
APC is no longer supported in favor of opcache that comes bundled with PHP, if you wish to use the user cache, then look at PECL/APCu.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 23:01:30 2024 UTC