Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apc_store() expects parameter 1 to be string #1119

Closed
agborkowski opened this issue Sep 11, 2014 · 5 comments
Closed

apc_store() expects parameter 1 to be string #1119

agborkowski opened this issue Sep 11, 2014 · 5 comments
Assignees

Comments

@agborkowski
Copy link
Contributor

default configuration of cache.php in production mode
this code

if ($cache != Libraries::cache()) {
            Cache::write('default', $key, Libraries::cache(), '+1 day');
}
var_dump($cache, Libraries::cache(), $key);
exit;

produce error

Warning: apc_store() expects parameter 1 to be string, array given in /usr/local/zend/var/apps/http/proj.dev/80/_docroot_/libraries/unionofrad/lithium/lithium/storage/cache/adapter/Apc.php on line 97
NULL array(170) { ["lithium\analysis\Logger"]=> string(1...

any suggestion ?

@mariuswilms
Copy link
Member

According to the current documentation apc_store() should accept multiple values as the first parameter wrapped in an array. That's what we're using with Lithium. It seems your version doesn't support that feature. We may need to workaround that.

Can you give me the output of php -i | grep -i apc as well as php -v?
Can you var_dump the contents of Libraries::cache()?

Are you using the dev branch? On which commit hash are you on?

@mariuswilms mariuswilms self-assigned this Sep 11, 2014
@mariuswilms mariuswilms added this to the 1.0 milestone Sep 11, 2014
@mariuswilms
Copy link
Member

I suspect your apc_store is actually zend_shm_cache_store as you're using zend server. Zend Server allows their data store to register apc methods. It seems it doesn't do it fully.

http://files.zend.com/help/Zend-Server/zend-server.htm#zendserverapi/zend_data_cache-configuration_directives.htm#dir-zend_datacache.apc_compatibility

http://files.zend.com/help/Zend-Server/zend-server.htm#zendserverapi/zend_data_cache-php_api.htm#function-zend_shm_cache_store

@mariuswilms mariuswilms removed this from the 1.0 milestone Sep 11, 2014
@nateabele
Copy link
Member

Yeah, the way they do this is kind of evil, actually. IMO this is a bug that should be filed with Zend.

@mariuswilms
Copy link
Member

@nateabele Short term I think it's sufficient to push this upstream, mid-term we should consider adding dedicated support for zend's caching methods to the core. I only find it hard to test in an automated way.

I'll open a new ticket for discussing the addition.

@agborkowski As Nate said this is an upstream bug and should be filed in Zend's Bug Tracker. Can you file the following bug with Zend? The bug description should mention:
You are using the zend_datacache.apc_compatibility feature and found out that the apc_store method is not correctly masked. It doesn't support the second syntax (mentioned here http://php.net/apc_store) which creates compatibility problems.

@agborkowski
Copy link
Contributor Author

yes ill try push this bug to zend thanx to watch out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants