Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8627945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:24:35+00:00 2026-06-12T08:24:35+00:00

cakephp debug messages still displaying with debug set to 0 using ajax and json.

  • 0

cakephp debug messages still displaying with debug set to 0 using ajax and json. I cannot set autorender to false, as I need to set the header to send json.

json.ctp

<?php
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
header('Content-Type: application/json');
header("X-JSON: ".$json);
echo $json;
?> 

Controller

function index(){

        if (!empty($this->data)){

            // Handle all JSON requests here
            if ($this->RequestHandler->isAjax()){

                $domain = $this->data['domain'];

                        $results = $this->Domain->google_api($domain,$seo_action);

                $json = json_encode($results);

                $this->set(compact('json'));

                $this->render('json','ajax');

            } else {

                $domain = $this->data['Results']['domain'];

            }

        }

        $this->set(compact('domain'));

        $this->layout = 'front_end';
    }

app_controller

function beforeFilter(){

        if ($this->RequestHandler->isAjax()) Configure::write('debug', 0);

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:24:36+00:00Added an answer on June 12, 2026 at 8:24 am

    You can put the Configure::write('debug', 0); as first line to your json.ctp. so that it will:

    <?php
      Configure::write('debug', 0);
      header("Pragma: no-cache");
      header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
      header('Content-Type: application/json');
      header("X-JSON: ".$json);
      echo $json;
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using CakePHP in PHP development. I have set my debug mode to
I'm working with CakePHP and i need to send email with attachment here is
I've set my Cakephp 1.3 debug level to 0 and whenever a user logs
CakePHP has a requireSecure function in the SecurityComponent. I'm using this to force SSL
I am using CakePHP. I created an external class which is not a model
I am using cakephp 2.1 and i am trying to upload files and how
I am using CakePHP 2.1 and trying to upload files into server. I can
I am using cakePHP 1.26. I got a simple Table with some data in
I am using the framework cakePHP for my application. I programmed it on localhost
When core.php debug is set at 1 or 2 and I browse to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.