ZF-7723: zf Unable to create action for a contoller in ZendFramework

Description

I am using ZendFramework version 1.9.0 and PHP 5.2.10 on Fedora 11

I am getting error message while creating an action for my project.

In order to test-create an action, I gave following commands:

$ zf create project tstproj $ cd tstproj $ zf create controller tstcnt $ zf create action actn tstcnt

I received:

Fatal error: Call to undefined function token_get_all() in .../ZendFRamework/library/Zend/ReflectioN/File.php on line 300

Can any one please help?

Regards. AQK

Comments

you dont have the tokenizer extension installed with PHP 5 then. It strikes me why this isnt bundled with PHP on Fedora, since its quite basic.

However although is not an issue of ZF, it would probably still be good to add a check for the tokenizer extension at that point and throw an exception with details.

In order to check whether the tokenizer extension is installed with PHP 5.2.9 on Fedora 11, I wrote following simple script:

<?php $contents = '<?php echo; ?>'; $token = token_get_all($contents); echo "Token : $token"; ?>

When I ran it on my server, It worked fine and gave output:

Token: Array

Surprisingly, the same tokenizer function,

token_get_all($contents) ;

does not work in the .../ZendFRamework/library/Zend/ReflectioN/File.php

I checked the PHP Information for PHP Version 5.2.9 . The Tokeniser Support is enabled.

This is weird :-)

Seems as though you do not have tokenizer support enabled (is this not a default extension?)

I have the same issue and although this has been closed, I don't see the resolution. I am working my way through the quickstart tutorial and cannot finish until I can resolve this. I have CentOS release 5.4 (Final) and Zend Framework Version: 1.10.3. I have determined that tokenizer is installed by invoking php -m | tokenizer. I get the same error "Fatal error: Call to undefined function token_get_all()". I feel like I have to get my answer from zend because configuration is different since installation. If I can find an answer i will try to come back and post it. This is the second error I ran into while trying the tutorial.