Bug 215129

Summary: devel/php70-APCu: apc_fetch() does not work
Product: Ports & Packages Reporter: townwear
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: daniel
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (daniel)
Hardware: i386   
OS: Any   

Description townwear 2016-12-08 01:43:08 UTC
php70-APCu is installed.

apc_fetch() does not work.

Fatal error: Uncaught Error: Call to undefined function apc_fetch() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

$ php -i | grep -i apc
/usr/local/etc/php/ext-20-apcu.ini,
apcu
APCu Support => Disabled
APCu Debugging => Disabled
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.entries_hint => 4096 => 4096
apc.gc_ttl => 3600 => 3600
apc.mmap_file_mask => no value => no value
apc.preload_path => no value => no value
apc.serializer => php => php
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.slam_defense => On => On
apc.smart => 0 => 0
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.writable => /tmp => /tmp
Comment 1 Daniel Ylitalo 2016-12-08 09:19:54 UTC
apc_fetch is only available in the old apc module

It's apcu_fetch now-a-days

http://php.net/manual/en/function.apcu-fetch.php

[daniely@edge-se ~]$ php --version
PHP 7.0.11 (cli) (built: Sep 27 2016 09:12:17) ( NTS )
Copyright (c) 1997-2016 The PHP Group
[daniely@edge-se ~]$ php -r 'var_dump(function_exists("apcu_fetch"));'
bool(true)
Comment 2 townwear 2016-12-09 05:17:07 UTC
In case of php56(pecl-APCu-4.0.10_1), apc_fetch was work.
Will not it be the same in php7 ?

$ php -v
PHP 5.6.28 (cli) (built: Nov 29 2016 01:17:04)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

$ php -i | grep -i apc
/usr/local/etc/php/ext-20-apcu.ini,
apc
APC support => Emulated
apcu
APCu Support => Disabled
APCu Debugging => Disabled
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.entries_hint => 4096 => 4096
apc.gc_ttl => 3600 => 3600
apc.mmap_file_mask => /dev/zero => /dev/zero
apc.preload_path => no value => no value
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => php => php
apc.shm_segments => 1 => 1
apc.shm_size => 256M => 256M
apc.slam_defense => On => On
apc.smart => 0 => 0
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.writable => /tmp => /tmp

$ php -r 'var_dump(function_exists("apcu_fetch"));'
bool(true)

$ php -r 'var_dump(function_exists("apc_fetch"));'
bool(true)
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2016-12-09 05:32:24 UTC
% pkg info -x APCu
php70-APCu-5.1.7
% php -r 'var_dump(function_exists("apcu_fetch"));'
bool(true)
% php -r 'var_dump(function_exists("apc_fetch"));'
bool(false)
Comment 4 Daniel Ylitalo 2016-12-26 13:25:45 UTC
php70-APCu is running apcu 5.1
pecl-APCu is running apcu 4.0

Backwards compatibility was removed in APCu 5 hence the apc_ functions doesnt work anymore.
Comment 5 Daniel Ylitalo 2016-12-26 13:27:10 UTC
This PR can be closed as won't fix, works as intended.
Comment 6 townwear 2016-12-27 02:52:49 UTC
Thank you very much.