CakePhp 2.6.3 Not Working on PHP 7 - cakephp

Fatal error: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/hrportal/app/Controller/AppController.php(72): ErrorHandler::handleError(8, 'Undefined index...', '/var/www/html/h...', 72, Array) 3 /var/www/html/hrportal/lib/Cake/Event/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent)) 4 /var/www/html/hrportal/lib/Cake/Controller/Controller.php(676): CakeEventManager->dispatch(Object(CakeEvent)) 5 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer.php(154): Controller->startupProcess() 6 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(FatalErrorException)) 7 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(FatalErrorException)) 8 in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php on line340
This error is coming as i have upgraded my system to PHP 7.0.
I have CakePHP application , that was working on 5.5.9 Perfectly ,
Now this error is coming please help .

CakePHP 2.6 is not compatible with PHP 7
https://book.cakephp.org/2.0/en/installation.html

try cakephp 2.9 release if you don't want to use 3.x

According to Cakephp 2.x documentation. Below are the PHP
Requirements for Cakephp 2.x
PHP 5.3.0 or greater (CakePHP version 2.6 and below support PHP 5.2.8
and above). CakePHP version 2.8.0 and above support PHP 7. To use PHP
above 7.1 you may need to install mcrypt via PECL. See Security for
more information.

For PHP 7 you have to use 2.9.x

Related

How can I install cakephp2 in 2022?

can anyone tell me how can I install cakephp 2 in 2022 I tried many ways to install it I also have its zip file which I extract it and when I tried to run it it shows.
Fatal Error
Error: Cannot use 'String' as class name as it is reserved
File: E:\xampp\htdocs\cakephp2.3\lib\Cake\Utility\String.php
Line: 27
Notice: If you want to customize this error message, create app\View\Errors\fatal_error.ctp
CakePHP 2 needs php5
since Version 2.8 you can use php70
php71 is possible but you need to install mcrypt seperatly.
Its possible to run a CakePHP 2.8 on php72 with some core hacks. But i wouldn't recommend this.
I got my answer we can download its zip file from github and copy its file in htdocs folder and run it without an issue. By the way I downloaded cakephp 2.10. and it is also running in xampp with php version 8. If in your system it is not running then try to use xampp with php version 7.

I can install eloquent-sluggable in laravel 5.5 there are some errors

I wanted to install eloquent-sluggable but I get this type of error
and my laravel version =5.5 and my php version is 7.0 but I don't know what can I do with this error.
If u know please help me.
My error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- illuminate/support v5.6.3 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
- illuminate/support v5.6.2 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
- illuminate/support v5.6.1 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
- illuminate/support v5.6.0 requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement.
- cviebrock/eloquent-sluggable 4.5.0 requires illuminate/support ~5.6.0 -> satisfiable by illuminate/support[v5.6.0, v5.6.1, v5.6.2, v5.6.3].
- Installation request for cviebrock/eloquent-sluggable 4.5 -> satisfiable by cviebrock/eloquent-sluggable[4.5.0].
Installation failed, reverting ./composer.json to its original content.
-------
I followed the related site but I can solve it.
Thanks.
Yes, you should be able to do that. The problem is pretty simple: As the error message says, these packages need at least PHP 7.1.3, while you have PHP 7.0.10 installed:
requires php ^7.1.3 -> your PHP version (7.0.10) does not satisfy that requirement
Updating your PHP version would to the trick. How this is done depends on how your development environment is setup.

Unsupported major.minor version 51.0

I'm developing with CodenameOne in the IntelliJ IDE. When I choose "Send MacOS Desktop Build", I get this error message:
Unsupported major.minor version 51.0
My project SDK says 1.5 (Java Version 1.6.0_65)
My Language level is set to 5.0
I've done a rebuild, which should recompile everything, but I still get this error. Version 51 refers to Java 7. Can anyone tell me how to fix this?
Does your project have any 3rd party cn1libs? It is possible some of them have been compiled with Java 7.
A workaround in that case would be to change your project to use Java 8. (I think that is supported in IntelliJ, but not 100% sure). For changing the project to Java 8 there are a few settings you need to change. It is usually just easier to start a new project and check "Java 8" in the wizard. Then copy your sources over.
Please find the list of major minor version related issue.
J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45
We can change the required compatible JDK Version from Configuration Page and it should work out.
This is a problem because we require a minimum of JDK 1.7 and now recommend JDK 8. You need to set IntelliJ to use that JDK and configure it to use it.
I had this issue while running cxf soap client.
Server: apache-tomcat-7.0.33
Error: java.lang.UnsupportedClassVersionError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean :
Unsupported major.minor version 51.0
Resolution: Resolved this by compiling the app using jdk1.8.0_65. Earlier i was using jdk1.7.

Please describe how to upgrade cakephp version 0.2.9

Please describe how to upgrade cakePhp version 0.2.9 to any latest version of cakephp .
Are you sure this is the cakephp version you want to update?
The current version of Cake 2.0 in /path/to/cake/lib/Cake/VERSION.txt. The txt file contains a commented block stating that it has been there since Cake 0.2.9, followed by the actual version number.
The same file may be found in Cake 1.3 in /path/to/cake/cake/VERSION.txt.
0.2.9 is not your cake php version.Its a first version of cake php that is written like #since CakePHP(tm) v 0.2.9.You can find your cake php version just go to the path cake/lib/Cake/VERSION.txt.In last line of version.text you will find your cake php version. t's easy to miss, but it should just be a number, e.g. 1.3.8."

agile toolkit 4.3 installation error

I have downloaded the new version(4.3) but when I go to the
http://localhost/agiletoolkit/
this error is shown:
Parse error: syntax error, unexpected '[' in phar://D:/wamp/www/agiletoolkit/agiletoolkit-sandbox.phar/lib/AgileToolkit/Installer.php on line 73
could you please help me how to install the new version?
Thanks
New ATK 4.3 version mostly use new PHP array notation [1,2,3] instead of old array(1,2,3) which is available only if you use PHP 5.4 and up.
So, please upgrade your PHP installation to at least 5.4 and then try again.

Resources