Ask your Symfony questions! Pay money and get answers fast! (more info)

What is the path for Pecl on a Mac? Symfony

  • SOLVED

My first time working with Symfony2. I am at a company with an old, large Symfony2 project. I am setting things up to run locally on a Mac.

I run:

php admin/app/check.php

and get this error:

[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED
*** Upgrade your APC extension (3.0.17+) ***
You must fix this problem before resuming the check.

but if I do this:

sudo pecl install apc

I get:

pecl/apc is already installed and is the same as the released version 3.1.13
install failed

I am going crazy with this.

Full transcript below.


12:13:48 : bonsai $ php admin/app/check.php
********************************
* *
* Symfony requirements check *
* *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* If this is the case, please ALSO launch this
* utility from your web server.
** WARNING **

** Mandatory requirements **

OK Checking that PHP version is at least 5.3.2 (5.4.15 installed)
OK Checking that the "date.timezone" setting is set
OK Checking that app/cache/ directory is writable
OK Checking that the app/logs/ directory is writable
OK Checking that the json_encode() is available
OK Checking that the SQLite3 or PDO_SQLite extension is available
OK Checking that the session_start() is available
OK Checking that the ctype_alpha() is available

** Optional checks **

OK Checking that the PHP-XML module is installed
OK Checking that the libxml version is at least 2.6.21
OK Checking that the token_get_all() function is available
OK Checking that the mb_strlen() function is available
OK Checking that the iconv() function is available
OK Checking that the utf8_decode() is available
OK Checking that the posix_isatty() is available


[[WARNING]] Checking that the intl extension is available: FAILED
*** Install and enable the intl extension (used for validators) ***


[[WARNING]] Checking that a PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***


[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED
*** Upgrade your APC extension (3.0.17+) ***
You must fix this problem before resuming the check.
12:29:41 : bonsai $
12:35:19 : bonsai $
12:35:19 : bonsai $
12:35:19 : bonsai $ find . -name "params.sh" -type f
12:35:41 : bonsai $ find . -name "params.sh"
12:35:57 : bonsai $
12:55:11 : bonsai $
12:55:12 : bonsai $
12:55:12 : bonsai $
12:55:12 : bonsai $
12:55:12 : bonsai $
12:55:16 : bonsai $
12:55:16 : bonsai $
12:55:16 : bonsai $ php admin/app/check.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): image not found in Unknown on line 0
********************************
* *
* Symfony requirements check *
* *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* If this is the case, please ALSO launch this
* utility from your web server.
** WARNING **

** Mandatory requirements **

OK Checking that PHP version is at least 5.3.2 (5.4.15 installed)
OK Checking that the "date.timezone" setting is set
OK Checking that app/cache/ directory is writable
OK Checking that the app/logs/ directory is writable
OK Checking that the json_encode() is available
OK Checking that the SQLite3 or PDO_SQLite extension is available
OK Checking that the session_start() is available
OK Checking that the ctype_alpha() is available

** Optional checks **

OK Checking that the PHP-XML module is installed
OK Checking that the libxml version is at least 2.6.21
OK Checking that the token_get_all() function is available
OK Checking that the mb_strlen() function is available
OK Checking that the iconv() function is available
OK Checking that the utf8_decode() is available
OK Checking that the posix_isatty() is available


[[WARNING]] Checking that the intl extension is available: FAILED
*** Install and enable the intl extension (used for validators) ***


[[WARNING]] Checking that a PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***


[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED
*** Upgrade your APC extension (3.0.17+) ***
You must fix this problem before resuming the check.
12:55:21 : bonsai $ brew install autoconf
Warning: Your Xcode (4.6) is outdated
Please install Xcode 4.6.2.
Warning: autoconf-2.69 already installed
13:28:58 : bonsai $ autoconf
autoconf: error: no input file
13:29:12 : bonsai $ brew install pcre
Warning: Your Xcode (4.6) is outdated
Please install Xcode 4.6.2.
Warning: pcre-8.32 already installed
13:29:12 : bonsai $
13:29:12 : bonsai $ sudo pecl install apc
Password:
pecl/apc is already installed and is the same as the released version 3.1.13
install failed
13:29:32 : bonsai $ sudo pecl install apc
pecl/apc is already installed and is the same as the released version 3.1.13
install failed
13:29:50 : bonsai $ which apc
13:30:19 : bonsai $ which pecl
/usr/local/bin/pecl
13:31:55 : bonsai $ which pecl/apc
13:32:02 : bonsai $ which pecl apc
/usr/local/bin/pecl
13:32:06 : bonsai $ php admin/app/check.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): image not found in Unknown on line 0
********************************
* *
* Symfony requirements check *
* *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* If this is the case, please ALSO launch this
* utility from your web server.
** WARNING **

** Mandatory requirements **

OK Checking that PHP version is at least 5.3.2 (5.4.15 installed)
OK Checking that the "date.timezone" setting is set
OK Checking that app/cache/ directory is writable
OK Checking that the app/logs/ directory is writable
OK Checking that the json_encode() is available
OK Checking that the SQLite3 or PDO_SQLite extension is available
OK Checking that the session_start() is available
OK Checking that the ctype_alpha() is available

** Optional checks **

OK Checking that the PHP-XML module is installed
OK Checking that the libxml version is at least 2.6.21
OK Checking that the token_get_all() function is available
OK Checking that the mb_strlen() function is available
OK Checking that the iconv() function is available
OK Checking that the utf8_decode() is available
OK Checking that the posix_isatty() is available


[[WARNING]] Checking that the intl extension is available: FAILED
*** Install and enable the intl extension (used for validators) ***


[[WARNING]] Checking that a PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***


[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED
*** Upgrade your APC extension (3.0.17+) ***
You must fix this problem before resuming the check.
13:33:16 : bonsai $ pecl list-all

Warning: lstat(): Lstat failed for /var/folders/kr/pgx6tzks6kg48hgdnj1f7dt80000gn/T//pear/cache/c2d1a60433ecd5bceb8756e268e2ebb3rest.cacheid in PEAR/REST.php on line 276

Warning: lstat(): Lstat failed for /var/folders/kr/pgx6tzks6kg48hgdnj1f7dt80000gn/T//pear/cache/c2d1a60433ecd5bceb8756e268e2ebb3rest.cacheid in /usr/local/Cellar/php54/5.4.15/lib/php/PEAR/REST.php on line 276
Could not open /var/folders/kr/pgx6tzks6kg48hgdnj1f7dt80000gn/T//pear/cache/c2d1a60433ecd5bceb8756e268e2ebb3rest.cacheid for writing.

Answers (4)

2013-05-14

Martin Palacio answers:

as stated in the INSTALL file (php-apc for ubuntu, original source package):


; Suggested Configuration (in your php.ini file)
; -------------------------------------------
extension=apc.so
apc.enabled=1
apc.shm_size=128M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=1


Please note that there is some insight about APC + PHP 5.4 in [[LINK href="http://stackoverflow.com/questions/9611676/is-apc-compatible-with-php-5-4-or-php-5-5"]]StackOverflow[[/LINK]].

Good luck!


Martin Palacio comments:

<blockquote>
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): Symbol not found: _zend_signal_globals

Referenced from: /usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so

Expected in: flat namespace
</blockquote>

Does not look good at all. Looks your apc extension (installed via pecl?) is not "compatible" with your PHP (maybe is missing some compilation flag, but can't find which one).

I would try to remove APC and PHP, and start over with brew.

BTW which OS do you have on your Mac?


Martin Palacio comments:

Please note that APC 3.1.13 [[LINK href="http://pecl.php.net/package/APC"]]is marked as beta[[/LINK]]. Try to download the [[LINK href="http://pecl.php.net/get/APC-3.1.9.tgz"]]latest stable source[[/LINK]] (3.1.9) and compile it yourself with:

phpize
./configure
make
[copy extension file to desired location]

This may sound unrelated (if not crazy): The installation wizard on XDebug site can help you for this process (instead of download and compile XDebug source, try with the APC source). It's great because it will detect your OS / PHP settings and will give you "tailored instructions" that may work for you.


Martin Palacio comments:

sorry, forgot the XDebug Wizard link: http://xdebug.org/wizard.php.


Lawrence Krubner comments:

Martin, that was a useful tip. I compiled it myself and now it seems to be working.

2013-05-16

farfanoide answers:

hi! firs of all, have you properly updated your PATH after installing homebrew?
you should have something like PATH="/usr/local/bin:${PATH}" in your .bashrc/.bash_profile
after checking that i'd fix permissions for pear and reinstall apc, although the problem seems to be your PATH.
it should say :
* Configuration file used by PHP: /usr/local/etc/php/5.4/php.ini
to fix pear permissions
chmod -R ug+w /usr/local/Cellar/php54/5.4.15/lib/php
pear config-set php_ini /usr/local/etc/php/5.4/php.ini


Lawrence Krubner comments:

farfanoide, thank you, I am not sure, but there might have been a permissions issue.

2013-05-14

Luis Cordova answers:

use brew install those things and you will be fine

/usr/local/Cellar/php54/5.4.15/include/php/ext/apc

and that is with brew


Lawrence Krubner comments:

What do you mean? Brew install what? Everything is installed. That is the confusion. I get:

pecl/apc is already installed and is the same as the released version 3.1.13

and:

[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED


Lawrence Krubner comments:

Clearly, "sudo pecl install apc" is installing apc to one path, but Symfony2 is checking some other path. But I can not figure out what either of the paths are. If I knew the Symfony path, I would just "ln -s target alias" and fix this.


Lawrence Krubner comments:

And this:

find / -name "apc"

gives me:

find: /backups/livedbs-dumps/Maildir: Permission denied
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/local/Cellar/php54/5.4.15/include/php/ext/apc


Lawrence Krubner comments:

And I see this in check.php:



$accelerator =
(function_exists('apc_store') && ini_get('apc.enabled'))
||
function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
||
function_exists('xcache_set')
;
check($accelerator, 'Checking that a PHP accelerator is installed', 'Install a PHP accelerator like APC (highly recommended)', false);
check(function_exists('apc_store') && ini_get('apc.enabled') && version_compare(phpversion('apc'), '3.0.17', '>='), 'Checking that the APC version is at least 3.0.17', 'Upgrade your APC extension (3.0.17+)', true);


Lawrence Krubner comments:

I see this issue was brought up 2 years ago:

https://github.com/symfony/symfony-standard/pull/163/files


Lawrence Krubner comments:

I added this to php.ini:

extension=/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so

which points to the correct file. Now when I do:

php admin/app/check.php

I get:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): Symbol not found: _zend_signal_globals
Referenced from: /usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so
Expected in: flat namespace
in /usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so in Unknown on line 0
********************************
* *
* Symfony requirements check *
* *
********************************

php.ini used by PHP: /etc/php.ini

** WARNING **
* The PHP CLI can use a different php.ini file
* than the one used with your web server.
* If this is the case, please ALSO launch this
* utility from your web server.
** WARNING **

** Mandatory requirements **

OK Checking that PHP version is at least 5.3.2 (5.4.15 installed)
OK Checking that the "date.timezone" setting is set
OK Checking that app/cache/ directory is writable
OK Checking that the app/logs/ directory is writable
OK Checking that the json_encode() is available
OK Checking that the SQLite3 or PDO_SQLite extension is available
OK Checking that the session_start() is available
OK Checking that the ctype_alpha() is available

** Optional checks **

OK Checking that the PHP-XML module is installed
OK Checking that the libxml version is at least 2.6.21
OK Checking that the token_get_all() function is available
OK Checking that the mb_strlen() function is available
OK Checking that the iconv() function is available
OK Checking that the utf8_decode() is available
OK Checking that the posix_isatty() is available


[[WARNING]] Checking that the intl extension is available: FAILED
*** Install and enable the intl extension (used for validators) ***


[[WARNING]] Checking that a PHP accelerator is installed: FAILED
*** Install a PHP accelerator like APC (highly recommended) ***


[[ ERROR ]] Checking that the APC version is at least 3.0.17: FAILED
*** Upgrade your APC extension (3.0.17+) ***
You must fix this problem before resuming the check.




Luis Cordova comments:

do not keep hacking stuff, remove all your stuff and install cleanly only with brew the stuff even apc, do not play manually with stuff


Lawrence Krubner comments:

Luis Cordova, I have installed most things with brew, but I don't remember what things were not installed with brew.

Still, the question remains, what path does Symfony check? Why does it not see that I have APC installed?

I currently have this in my php.ini:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; ... or with a path:
;
; extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;

extension=/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so


Luis Cordova comments:

you can uninstall and reinstall with brew and it will tell you where things are

2013-05-15

mullerivan answers:

buy a linux machine


Lawrence Krubner comments:

mullerivan, my client has a team that mostly develops on Macs. They also have a VM of our Centos environment. They suggested that I install it on the Mac using VirtualBox, but I could not get the network settings to work. I kept getting "Invalid settings". One of the instructions was "refresh your MAC address" but the setting was frozen and I could not find a way to get the dialogue box to unfreeze that option.

All the same, it would be easy to switch to a Linux machine, if I thought this would be easier on a Linux machine. But I've wasted 2 whole days trying to get setup on this Mac, and I am fairly sure I would waste 2 whole days trying to get set up on Linux.


Lawrence Krubner comments:

Let's focus on this:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): Symbol not found: _zend_signal_globals
Referenced from: /usr/local/Cellar/php54/5.4.15/lib/php/extensions/no-debug-non-zts-20100525/apc.so
Expected in: flat namespace



Has anyone seen this error before?