I'm trying to set up my Zend installation but when I run zf show version in the CLI I get this error message:
Fatal error: Class 'Zend\Filter\Word\CamelCaseToSeparator' not found in C:\Progr
am Files (x86)\EasyPHP-12.1\php\php546x120828095553\ZendFramework-2.0.3\library\
Zend\Filter\Word\CamelCaseToDash.php on line 18
I haven't changed anything in the files and they're in the right place with the correct names and everything.
Does anyone of you know what the error could be?
I had the same problem when I had 2 zend framework libaries includes in php.ini file for zend framework 1 and 2 versions, when I left only one, this error disapeared.
Related
I am trying to initialize php unit testing with my wordpress plugin using phpunit. I am running xampp on windows. My xampp installation is also on my E: drive if that makes any difference. I am following along with this tutorial:
https://www.smashingmagazine.com/2017/12/automated-testing-wordpress-plugins-phpunit/
I have gotten to the part where I run
install-wp-tests.sh wordpress_test root '' localhost latest
I run that and it pops up and closes quickly, so I don't know if it is really working or not. I then try to run
phpunit tests/test-sample.php
and I get:
PHP Fatal error: Class 'WP_UnitTestCase' not found in E:\xampp\htdocs\wp-content\plugins\SRBC\tests\test-sample.php on line 11
Fatal error: Class 'WP_UnitTestCase' not found in E:\xampp\htdocs\wp-content\plugins\SRBC\tests\test-sample.php on line 11
I assume that means the install-wp-test.sh isn't installing correctly and it is missing those classes. Any ideas?
Ended up needing to install SVN for windows. Also had to add the mysqladmin.exe path to the PATH environment variable. Then finally needed this :
https://wordpress.stackexchange.com/questions/249402/error-when-setting-up-phpunit-tests-with-wp-cli-scaffold
And after all that and 3 hours! I got it to work correctly!
Hope this helps someone else.
I'm migrating a CakePHP 1.3 app from an old server to a new one, the website works fine but the Shells fail with the following error:
PHP Fatal error: Class 'AppModel' not found
And the error points to the declaration of a model that extends from the AppModel class. It also somewhat strangely prints the contents of the AppModel class to stdout. Full stack trace below.
PHP Fatal error: Class 'AppModel' not found in /home/andyburchill/src/site/app/models/account.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/andyburchill/src/site/cake/console/cake.php:0
PHP 2. ShellDispatcher->ShellDispatcher() /home/andyburchill/src/site/cake/console/cake.php:665
PHP 3. ShellDispatcher->dispatch() /home/andyburchill/src/site/cake/console/cake.php:139
PHP 4. Shell->initialize() /home/andyburchill/src/site/cake/console/cake.php:337
PHP 5. Shell->_loadModels() /home/andyburchill/src/site/cake/console/libs/shell.php:180
PHP 6. ClassRegistry->init() /home/andyburchill/src/site/cake/console/libs/shell.php:257
PHP 7. App->import() /home/andyburchill/src/site/cake/libs/class_registry.php:143
PHP 8. App->__find() /home/andyburchill/src/site/cake/libs/configure.php:962
PHP 9. App->__load() /home/andyburchill/src/site/cake/libs/configure.php:1043
PHP 10. require() /home/andyburchill/src/site/cake/libs/configure.php:1067
I'm running the shell from the root directory with the following command:
./cake/console/cake queue
The most notable difference between the servers is the PHP version, the shells are working on PHP 5.4.9 and are not working on PHP 5.5.9.
I have been googling this for a couple of days, usually people seem to get this error after upgrading to CakePHP 2.x and the fixes don't work for CakePHP 1.3.
I'm beginning to think the only solution is going to be upgrading to 2.x, but this is not a trivial task.
Is there something I can do in the mean time to get this working?, can anyone suggest troubleshooting tips?.
Ok I feel a bit silly now.
I had tried Raphael's suggestion of requiring the class file previously but I decided to try again and noticed that the AppModel class file started with a short open tag instead of <?php.
After changing it the shells now work.
I am trying to make a project work. But I am getting an error like this:
Class 'App' not found in /var/www/html/project/test.php on line 4
line 4 of this file says:
app::$activepage = $_GET['_page'] ? httpget('_page') : $_POST['_page'] ? httppost('_page') : 0);
I am using cakePhp Version: 1.3.15-1.
The weird thing is that when I do apt show cakephp it says State: not installed
However, I have followed all the instructions of https://www.digitalocean.com/community/tutorials/how-to-install-cakephp-on-an-ubuntu-12-04-vps and when I open the index.php file of cakephp, it doesn't indicate any errors.
As I said in my Comment:
Your snippet / folder structure doesn't look like CakePHP.
Part of the problem may be a version mismatch. You say you're using version 1.3.15, but the tutorial on installing it that you link was created over a year later and references version 2.3.9. It looks like the general steps are the same, based on comparing your tutorial to the steps in the 2.X blog tutorial. You might have more luck with an older tutorial on using CakePHP on Ubuntu. Most of the steps look similar, but there are some differences with the .htaccess portion that could be causing the problem. Neither the 1.3 or 2.3 versions look like they require any "installing."
If you're not looking at the older version for any particular reason, of course it's best to use the most recent version of CakePHP, but I assume you have a particular reason for using that version. But if you're stuck, you might try a newer version to see if it gives the same errors.
I'm using this LdapBundle.
I have already installed it, but I catch an error:
Fatal error: Call to undefined method Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension::addSecurityListenerFactory() in C:\wamp\www\trainingboard\src\IMAG\LdapBundle\IMAGLdapBundle.php on line 41
I know that I have to change my Symfony version to 2.1. I tried to change folder Symfony in vendors, but after that I caught another error. So, I can't so simple change Symfony. Can you give me advice what to do?
P.S. Now I'm using the 2.0.9 version of Symfony
IMAGLdapBundle only works with Symfony 2.0.x
Instead you can try FR3DLdapBundle 1.6.x
I have two servers.
snow leopard on HFS (case-insensitive) file system
gentoo linux with ext4 (case-sensitive) file system
on both of them I use php 5.3 and latest apache2 and latest Zend Framework 1.11 build.
under Mac OSX the website works properly, under linux I have the following error:
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Jquery' was not found in the registry; used paths: Dashboard_View_Helper_: /home/ufk/Projects/php-projects/xpo-website/application/modules/dashboard/views/helpers/ xpo_Uploadify_View_Helper_: xpo/Uploadify/View/Helper/ ZendX_JQuery_View_Helper_: ZendX/JQuery/View/Helper/ : /home/ufk/Projects/php-projects/xpo-website/application/helpers/ Zend_View_Helper_: Zend/View/Helper/' in /usr/local/ZendFramework-1.11.3/library/Zend/Loader/PluginLoader.php:412 Stack trace:
0 /usr/local/ZendFramework-1.11.3/library/Zend/View/Abstract.php(1174): Zend_Loader_PluginLoader->load('Jquery')
1 /usr/local/ZendFramework-1.11.3/library/Zend/View/Abstract.php(610): Zend_View_Abstract->_getPlugin('helper', 'jquery')
2 /usr/local/ZendFramework-1.11.3/library/Zend/View/Abstract.php(336): Zend_View_Abstract->getHelper('jquery')
3 /home/ufk/Projects/php-projects/xpo-website/application/modules/dashboard/views/scripts/game/login.phtml(1): Zend_View_A in /usr/local/ZendFramework-1.11.3/library/Zend/Loader/PluginLoader.php on line 412
I copied the ZendX directory (from extras/library) to the library directory of the Zend Framework located at /usr/local/ZendFramework/library/ZendX/.
I initialize the helper using:
ZendX_JQuery::enableView($view);
the code inside login.phtml that is causing the exception is:
$this->jquery()->enable();
it shouldn't even relate to the code itself because under the Mac OS server it does work, but i do have ZendX here too so i can't pinpoint the problem.
Not able to test right now, but suspect you need to uppercase the 'q' in jQuery in this line:
$this->jQuery()->enable();
Typically ZF maps methods to class names by uppercasing the first letter, so could be the 'unusual' uppercase Q in the class name is the problem.
You have to add the helper path. See manual. You can do that in bootstrap, using Zend_Application, using FrontController plugin, in base controller class or directly in view.
Update: Sorry I misread your question. The problem IS the small "q". Windows is case insensitive. That's why it works there. Linux is not. So 'jQuery.php' and 'jquery.php' are not the same files.