Error while executing zf.sh in Zend Framework 2 - php

In Zend Framework 2, I added the library directory to php include_path. But when I run zf.sh I get the following errors:
PHP Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in /var/www/html/zend/bin/zf.php on line 611
Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in /var/www/html/zend/bin/zf.php on line 611
I checked Library/Zend directory and there is not any directory named Tool.
Is there any extra step I should do?

Related

Laravel fatal error: Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found

I'm trying to start using laravel php framework. I'm trying to just call the index file and I get this error message.
C:\xampp\php\php.exe C:\xampp\htdocs\tutorials\lara\application\public\index.php
Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found in C:\xampp\htdocs\tutorials\lara\application\bootstrap\cache\compiled.php on line 357
Process finished with exit code 255
Can anyone shine some light on what this means?
Your Illuminate\Auth\Illuminate\Contracts\Auth\Factory may not copied in your project,that why this is happening.So you need to be
Step 1 : Remove full vendor folder
Step 2 : Run from your terminal composer install

Class 'ZurmoBaseTest' not found in EmailTemplateTest.php

I'm trying to run unit tests on zurmo and I've a problem, when I try the EmailTemplateTest. I get
Fatal error: Class 'ZurmoBaseTest' not found in zurmo\app\protected\
modules\emailTemplates\tests\unit\EmailTemplateTest.php on line 42
If I try to include it with require it fixes this, but then
Fatal error: Class 'BaseTest' not found in zurmo\app\protected\modul
es\zurmo\tests\unit\ZurmoBaseTest.php on line 38
and
Fatal error: Class 'RedBeanDatabase' not found in zurmo\app\protecte
d\core\tests\unit\BaseTest.php on line 44
If I include them both I get the final
Fatal error: Class 'Yii' not found in zurmo\app\protected\core\model
s\RedBeanDatabase.php on line 37
What's the problem? Am I supposed to run it from some exact location or the installation is not default. I installed it with the settup and the app is working itself.
You bootstrap is likely missing the autoloader of your framework and / or your framework's PHPUnit extension.
For anyone else looking for the answer to this one. You should run it via TestSuite.php
phpunit TestSuite.php EmailTemplateTest
TestSuite.php will include the necessary files for you.
http://zurmo.org/tutorials/running-unit-tests-explained

Class not found fuelphp oil

i am trying to run fuelphp 1.6 oil on ubuntu server and i get this error message:
PHP Fatal error: Class 'Error' not found in /home/user/public_html/fuel/core/bootstrap.php on line 79
Fatal error: Class 'Error' not found in /home/user/public_html/fuel/core/bootstrap.php on line 79
PHP Fatal error: Class 'Config' not found in /home/user/public_html/fuel/core/bootstrap.php on line 47
Fatal error: Class 'Config' not found in /home/user/public_html/fuel/core/bootstrap.php on line 47
The command i run:
php oil
Any suggestion ?
Probably your autoloader in not correctly configured. This is the first place I would look.
There is nothing to configure in Fuel's autoloader.
FuelPHP uses the COREPATH constant defined in your index.php to find the framework's core classes, and this is defined correctly unless you have changed the location of the files.

Class 'Logger' not found in LoggerRoot.php

I'm trying to install log4php in a very simple site (trying to learn how it works).
Apache is installed in /etc/ and vhost is defined as:
DocumentRoot "/home/fferri/workspace/site-tutorial/www"
ServerName tutorial.localhost
php_value auto_prepend_file "/home/fferri/workspace/site-tutorial/www/ConfigureSite.php"
My site is at /home/fferri/workspace/site-tutorial/www/ and log4php folder is at /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/
Then, I define
define('LOG4PHP_DIR', "/home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/");
into ConfigureSite.php
And, into another file, I try to init log4php:
include(LOG4PHP_DIR."/Logger.php");
$log = Logger::getLogger("main");
$log->info("foo");
$log->warn("bar");
The error is always the same:
Fatal error: Class 'Logger' not found in /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/LoggerRoot.php on line 37
It's worth to say that LoggerRoot.php and Logger.php are in the same folder. I think I have a problem of paths because my server and my site aren't in the same folder, but I need some hint
Adding the complete stack trace of error:
[22-May-2012 11:34:38] PHP Fatal error: Class 'Logger' not found in /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/LoggerRoot.php on line 36
[22-May-2012 11:34:38] PHP Stack trace:
[22-May-2012 11:34:38] PHP 1. {main}() /home/fferri/workspace/site-tutorial/www/index.php:0
[22-May-2012 11:34:38] PHP 2. require_once() /home/fferri/workspace/site-tutorial/www/index.php:12
[22-May-2012 11:34:38] PHP 3. require_once() /home/fferri/workspace/site-tutorial/www/greet_at_opening.php:11
[22-May-2012 11:34:38] PHP 4. require_once() /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/Logger.php:24
[22-May-2012 11:34:38] PHP 5. require_once() /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/LoggerCategory.php:27
[22-May-2012 11:34:38] PHP 6. require_once() /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/spi/LoggerLoggingEvent.php:28
[22-May-2012 11:34:38] PHP 7. require_once() /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/LoggerManager.php:29
[22-May-2012 11:34:38] PHP 8. require_once() /home/fferri/workspace/site-tutorial/services/lib/log4php-0.9/src/log4php/LoggerHierarchy.php:28
So, first, Logger is found but on loading LoggerHierarchy, Logger isn't. Why????
SOLVED: The error is to use log4php-0.9 and php5 together. Downloading the library located in apache web (2.1), the problem is solved.
Thanks!
I think using dirname(__FILE__) will look better.
I also thought it would be the path...
Maybe the Class name defenition then. do you call new Logger in Logger.php?
What about something like:
include(LOG4PHP_DIR."/Logger.php");
$log = new Logger();
$log->info("foo");
The error is to use log4php-0.9 and php5 together. Downloading the library located in apache web (2.1), the problem is solved.

zf create project error (Zend Framework)

I got a error when I try create a project using the zend framework command line:
[user ~] /home/user/public_html $ zf create project openstart
PHP Catchable fatal error: Argument 1 passed to Zend_Tool_Framework_Client_Console_ArgumentParser::setArguments() must be an array, null given, called in /home/user/downloads/ZendFramework-1.10.5/library/Zend/Tool/Framework/Client/Console.php on line 194 and defined in /home/user/downloads/ZendFramework-1.10.5/library/Zend/Tool/Framework/Client/Console/ArgumentParser.php on line 79
Catchable fatal error: Argument 1 passed to Zend_Tool_Framework_Client_Console_ArgumentParser::setArguments() must be an array, null given, called in /home/user/downloads/ZendFramework-1.10.5/library/Zend/Tool/Framework/Client/Console.php on line 194 and defined in /home/user/downloads/ZendFramework-1.10.5/library/Zend/Tool/Framework/Client/Console/ArgumentParser.php on line 79
zf is a symlink to /home/user/downloads/ZendFramework-1.10.5/bin/zf.sh
Any ideas?
Try a newer version of Zend Framework if possible, they are at 1.11.10 now and I think a number of zend tool issues have been resolved since then.
If I run your command on the newest version I get no errors and the project is created.

Categories