CakePHP DebugKit causes an error - php

I want deploy my project on the server, so I need to disable DebugKit. I removed CakePlugin::load('DebugKit') from bootstrap.php and disabled it in AppController.
After that I started getting error 'Fatal error: Class "CakeSession" not found in /vagrant/lib/Cake/Controller/Component/SessionComponent.php on line 69'.
How can I solve my problem?

The error would indicate that your Cake installation is incomplete. Make sure you extracted the entire framework into your document root.
As for the DebugKit, you don't need to remove it explicitly, as it ceases to be loaded once you put the debug level in your app/Config/core.php file to 0 (as live applications should have their debug setting set).

Related

CodeIgniter version 3.x: Loading "Session" library reports ini_set warining

I am using Codeigniter 3.0.1 in a Wamp64 installation (PHP Ver 5.6.19, Apache 2.4.18) on a Windows Server 2012 R2.
When I have the line:
$autoload['libraries'] = array('session');
in autoload.php I get the following error on startup of my application:
ini_set() A session is active You cannot change the session module's
ini settings at this time. Filename: libraries/Session.php Line
Number: 313
If I take that line out of autoload.php and put the following line in the contructor function of the controllers that actually use the session data:
$this->load->library("Session")
I get the same error, but only when I start one of those controllers.
I have reviewed multiple answers to this question on stackoverflow:
Do you have a session_start() in your php code: NO - I have searched every piece of code included in this project and there is no session_start() anywhere
Do you have session.auto_start set equal to 0 (zero) in php.ini - YES
Neither of these answers solves my problem.
Session info is being written out to C:\temp on the server. I see the file is created when I start the controller that first loads the Session library so the web server seems to have write access to the C:\temp folder.
The other interesting thing is that I have no problem with the installation on my test server (Windows 7, php version 5.6.32)
Can anyone offer any suggestions? Thanks!
One more piece of information: This was an upgrade from 2.x to 3.0. I did delete the \system sub folder and replaced it with the V3 \system folder.
Found it.
The issue was an Ajax library (Sijax) which external to Codeigniter instantiated an instance of the class so that the methods could be called via Ajax. The new(class) triggered loading the Session class again, which ran through the initialization and tried to create the session again.
I removed the autoload of the Session class, and moved loading it to the Classes that require it, checking first to see if the Class already exists before calling the loader.

Laravel 5 class

I installed laravel 5.1 on my windows 7, after that i tried to open blog/app/Htttp/routes.php.Now there's a error on my browser saying
"Fatal error: Class 'Route' not found in
C:\xampp\htdocs\Laravel_1\blog\app\Http\routes.php on line 14".
How do i remove this error?
Before a class is available in PHP you will need to require/include it. As you have opened up the file directly in the browser, the laravel application is not bootstrapped and none of the dependencies are loaded to be used.
If you open up public/index.php, you will find a line that says
require __DIR__.'/../bootstrap/autoload.php';
// this later calls composer autoload which compiles a file
// that includes all the classes that you have specified in your `composer.json`.
Now that you have opened the file directly, non of the classes are included and hence you get the error.
I am not sure about your intentions for opening that file directly in the browser. I can only suggest you that the error is expected and you should go through the public/index.php for the application to work properly.

Zend framework in Xampp

I recently downloaded the full package version(recommended) of ZendFramework(2.0.5).And tried and failed to install in xampp(version 1.7.4) also my php version is 5.3.5 .
I have done almost everything that is said to do like-
1.find php.ini and add path
include_path = ".;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;"
2.Extract the downloaded Zend Framework folder and copy to your PHP include path.
I have also checked the folder(xampp,php,Zend) permissions too.I have checked and rechecked my tries multiple times but that error is not solved.
Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: .;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;
It has already taken mine whole day to check other forums,get ideas but none of then works.Please help .Thanks
Your path should probably be C:\xampp\zend\library\Zend.
You shoulnd't take the framework to the global include path but have it as a dependency in your project, soon you'll have two projects with two different versions of ZF and then the global option creates troubles
Hi there finally after doing every possible tries,my error was gone.
I don't know other cases but in my case i have done a series of mistake.So as i corrected them the error was gone.Here is what i did
1.In ZendFramework-2.0.5 the loader.php was missing.So following error occured
Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: .;C:\xampp\php\Zend\library\zend\;C:\xampp\php\PEAR;
For this i downloaded the ZendFramework-1.12.0(only in my case).And Loader.php was there
2.No two mistake of mine was i fractured the path from half.
i.e.If my folder structure was like
ZendFramework-1.12.0/library/Zend/..I add the half path to php.ini file
include_path = ".;C:\xampp\php\PEAR\;C:\xampp\php\Zend;"
which was a mistake so i, gave the path before the library folder
include_path = ".;C:\xampp\php\PEAR\;C:\xampp\php\Zend\library;"
and placed the folders according to path.
3.And what about environmental variables i read about?
They are not neccessary while installing the ZendFramework for the first time.After it i am not in that condn to say whether it should be added or not environmantal variables
C:\xampp\php
So,after doing above mentioned corrections and checking through the installation checker the error was gone.
And remember to restart(start and stop) the apache server after a tiny change in php.ini file.
thanks to markus-tharkun and Seth Battin a lot.You saved me.

Cakephp 2.0.4 bake error

I tried bake with Cakephp 2.0.4 stable with 'cake bake' command
But it's giving me below errors...
Unable to set console path for app/Console.
CakePHP is on your `include_path`. CAKE_CORE_INCLUDE_PATH will be set, but commented out.
Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in /home/wmetools/public_html/security/app/Console/myapp/webroot/index.php
Project baked but with some issues..
Your database configuration was not found. Take a moment to create one.
Is there a reason why this is happening?
If you meant to say
CakePHP is not on your include_path
** Code from the webroot/index.php file **
For ease of development CakePHP uses PHP's include_path. If you
cannot modify your include_path set this value.
Setting the include path will get rid of this error. There are two ways to accomplish this:
Edit your php ini file (on wamp this would be WAMPMENU->PHP->php.ini)
Better Description on how to.
or
// THIS METHOD IS NOT RECOMMENDED FOR THIS SITUATION
1. ini_set("include_path", ".:../:./include:../include");
If you do not want to mess with all that, just set the include path manually in the index.php file.

Error with propel-generate-crud in Symfony 1.0

When I try to generate a CRUD test for a new project I am getting a PHP Warning and a Fatal Error.
The errors relate to files that it cannot find, however, I have checked and the files are definitely there.
The error text is 'require_once(lib/model/map/QuestionMapBuilder.php): failed to open stream: No such file or directory in c:\webroot\askeet\lib\model\om\BaseQuestionPeer.php on line 547'
What details of my project should I check?
I think it's a problem with your include path.
Check it, the require_once() call is looking for lib/model/map/QuestionMapBuilder.php
But your include_path is C:\webroot\askeet\lib
Which, when resolved together into a full path, would look like this
C:\webroot\askeet\lib\lib\model\map\QuestionMapBuilder.php
So, I think your solution is to add C:\webroot\askeet to your include path.
You are generating crud for the Question model class but it doesn't seem to exist. Documentation on using the crud generator
First you must use the schema.yml file to define your database, and run
./symfony propel:build-model
to generate your model files. (this will generate lib\model\map\QuestionMapBuilder.php)
I finally tracked down the issue. In my PHP.ini files, they were setup wit the default UNIX file path settings.
Weirdly nothing had ever been broken by this incorrect configuration. Plus, everything in Symfony had worked up until now.
I have switched to Windows style file_path and all is well again.
Thanks for all the answers!

Categories