2016-01-19 3 views
0

У меня есть сайт CakePHP 2.5.1, размещенный на выделенном сервере CentOS, который установил CPanel (включая apache, exim, php и т. Д.), И на этом сайте у меня есть управление но по какой-то причине эта область работает только на локальном хосте, если я загружаю сайт на удаленный сервер, он просто показывает пустую страницу.CakePHP показывает пустую страницу без ошибок на удаленном сервере

Обс: весь остальной сайт работает правильно, только область управления, которая не работает.

Obs²: когда-нибудь я загрузил сайт на другой сервер, и область работала, поэтому я думаю, что проблема может быть связана с сервером.

Я запросил техническую поддержку с помощью CPanel, но они не могут мне помочь, пока они не знают, как работает CakePHP, но они пытались.

Я знаю, что внешние ссылки не рекомендуется использовать, кстати у меня в том, что я действительно не могу воспроизвести проблему на другом месте, так что есть ссылка на пустую страницу: http://www.acheiapartamento.com.br/biz/

Вот routes.php определяется (как вы можете видеть "/ Биз /" URL, указывающий на страницах индекса контроллера):

<?php 

/** 
* Routes configuration 
* 
* In this file, you set up routes to your controllers and their actions. 
* Routes are very important mechanism that allows you to freely connect 
* different URLs to chosen controllers and their actions (functions). 
* 
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* 
* Licensed under The MIT License 
* For full copyright and license information, please see the LICENSE.txt 
* Redistributions of files must retain the above copyright notice. 
* 
* @copyright  Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* @link   http://cakephp.org CakePHP(tm) Project 
* @package  app.Config 
* @since   CakePHP(tm) v 0.2.9 
* @license  http://www.opensource.org/licenses/mit-license.php MIT License 
*/ 
/** 
* Here, we are connecting '/' (base path) to controller called 'Pages', 
* its action called 'display', and we pass a param to select the view file 
* to use (in this case, /app/View/Pages/home.ctp)... 
*/ 
/* BIZ */ 
Router::connect('/biz/', array('controller' => 'pages', 'action' => 'index', 'biz' => 'true')); 


/* HOME */ 
Router::connect('/', array('controller' => 'home', 'action' => 'index')); 
Router::connect('/home', array('controller' => 'home', 'action' => 'index')); 

Router::connect('/classificados-home', array('controller' => 'home', 'action' => 'classificados')); 
Router::connect('/destaques-home', array('controller' => 'home', 'action' => 'destaques')); 
Router::connect('/lancamentos-home', array('controller' => 'home', 'action' => 'lancamentos')); 


/* EMPRESA */ 
Router::connect('/sobre', array('controller' => 'institucionais', 'action' => 'index')); 
Router::connect('/dicas', array('controller' => 'institucionais', 'action' => 'dicas')); 

/* EMPREENDIMENTOS */ 
Router::connect('/destaques', array('controller' => 'empreendimentos', 'action' => 'index')); 
Router::connect('/empreendimentos/enviar_contato', array('controller' => 'empreendimentos', 'action' => 'enviar_contato')); 
Router::connect('/destaques/:slug', array('controller' => 'empreendimentos', 'action' => 'interna')); 
Router::connect('/empreendimentos/:slug', array('controller' => 'empreendimentos', 'action' => 'interna')); 
Router::connect('/buscador', array('controller' => 'empreendimentos', 'action' => 'busca')); 
Router::connect('/resultado', array('controller' => 'empreendimentos', 'action' => 'resultado')); 
Router::connect('/classificados', array('controller' => 'empreendimentos', 'action' => 'classificados')); 
//Router::connect('/lancamentos', array('controller' => 'empreendimentos', 'action' => 'lancamentos')); 
Router::connect('/lancamentos/enviar_contato', array('controller' => 'lancamentos', 'action' => 'enviar_contato')); 
Router::connect('/lancamentos', array('controller' => 'lancamentos', 'action' => 'index')); 
Router::connect('/lancamentos/:slug', array('controller' => 'lancamentos', 'action' => 'interna')); 


/*EMPREENDIMENTOS BAIRROS*/ 
Router::connect('/bairros/busca', array('controller' => 'empreendimentos_bairros', 'action' => 'busca')); 

/*CLIENTE */ 
Router::connect('/blog', array('controller' => 'noticias', 'action' => 'index')); 
Router::connect('/blog/:slug', array('controller' => 'noticias', 'action' => 'interna')); 
Router::connect('/ache-para-mim', array('controller' => 'interesse', 'action' => 'index')); 
Router::connect('/ache-para-mim/comercial', array('controller' => 'interesse', 'action' => 'comercial')); 

Router::connect('/atendimentos', array('controller' => 'atendimentos', 'action' => 'index')); 
Router::connect('/clientes', array('controller' => 'clientes', 'action' => 'index')); 

Router::connect('/meus-favoritos', array('controller' => 'clientes', 'action' => 'index')); 
Router::connect('/meus-imoveis', array('controller' => 'clientes', 'action' => 'meus_imoveis')); 


Router::connect('/cadastre-seu-imovel', array('controller' => 'empreendimentos', 'action' => 'cliente_imovel')); 

Router::connect('/faq', array('controller' => 'faqs', 'action' => 'index')); 

Router::connect('/pergunte-ao-corretor', array('controller' => 'perguntas', 'action' => 'index')); 

/* CONTATO */ 
Router::connect('/contato', array('controller' => 'contatos', 'action' => 'index')); 

Router::connect('/aplicativo', array('controller' => 'aplicativos', 'action' => 'index')); 


Router::connect('/cortarimagem', array('controller' => 'empreendimentos', 'action' => 'cortarimagem')); 

/** EXPORTAÇÃO **/ 


/* IMPORTACAO */ 
Router::connect('/importacao/', array('controller' => 'empreendimentos', 'action' => 'importacao')); 
Router::connect('/importacao-imagem/', array('controller' => 'empreendimentos', 'action' => 'importacao2')); 

/* BEMORAR */ 
//Router::connect('/exp-bemorar/:id', array('controller' => 'bemorar', 'action' => 'index')); 



/** 
* Load all plugin routes. See the CakePlugin documentation on 
* how to customize the loading of plugin routes. 
*/ 
CakePlugin::routes(); 

/** 
* Load the CakePHP default routes. Only remove this if you do not want to use 
* the built-in default routes. 
*/ 
require CAKE . 'Config' . DS . 'routes.php'; 

Вот код PagesController.php:

<?php 

/** 
* Static content controller. 
* 
* This file will render views from views/pages/ 
* 
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) 
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* 
* Licensed under The MIT License 
* For full copyright and license information, please see the LICENSE.txt 
* Redistributions of files must retain the above copyright notice. 
* 
* @copyright  Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) 
* @link   http://cakephp.org CakePHP(tm) Project 
* @package  app.Controller 
* @since   CakePHP(tm) v 0.2.9 
* @license  http://www.opensource.org/licenses/mit-license.php MIT License 
*/ 
App::uses('AppController', 'Controller'); 
App::uses('UsersController', 'Controller'); 
App::uses('BannersController', 'Controller'); 

/** 
* Static content controller 
* 
* Override this controller by placing a copy in controllers directory of an application 
* 
* @package  app.Controller 
* @link http://book.cakephp.org/2.0/en/controllers/pages-controller.html 
*/ 
class PagesController extends AppController { 

    /** 
    * This controller does not use a model 
    * 
    * @var array 
    */ 
    public $uses = array(); 

    /** 
    * Displays a view 
    * 
    * @param mixed What page to display 
    * @return void 
    * @throws NotFoundException When the view file could not be found 
    * or MissingViewException in debug mode. 
    */ 
    public function display() { 

    $path = func_get_args(); 

     $count = count($path); 
     if (!$count) { 
      return $this->redirect('/'); 
     } 
     $page = $subpage = $title_for_layout = null; 

     if (!empty($path[0])) { 
      $page = $path[0]; 
     } 
     if (!empty($path[1])) { 
      $subpage = $path[1]; 
     } 
     if (!empty($path[$count - 1])) { 
      $title_for_layout = Inflector::humanize($path[$count - 1]); 
     } 
     $this->set(compact('page', 'subpage', 'title_for_layout')); 

     try { 
      $this->render(implode('/', $path)); 
     } catch (MissingViewException $e) { 
      if (Configure::read('debug')) { 
       throw $e; 
      } 
      throw new NotFoundException(); 
     } 

    } 

    public function biz_index() { 
     echo "teste"; 
    } 

    public function index() { 
     echo "teste"; 
     $produto = new ProdutosController(); 
     $this->set('produtos', $produto->Produto->find('all')); 
    } 

} 

Те же коды работают здесь, в localhost, phpinfo() localhost и мой удаленный сервер ALMOST то же самое, я проверил его.

Remote phpinfo() (не работает): https://drive.google.com/a/unesc.net/file/d/0Byyr3Jl114rReUg2cnhTSTZ2b1E/view

Localhost phpinfo() (работа): на бревнах не появится https://drive.google.com/a/unesc.net/file/d/0Byyr3Jl114rRSTVobzRic2NlWFk/view?usp=sharing

Отсутствия ошибок и пустые страницы, так что я не знаю, что делать, мне нужно исправить это так быстро, как только смогу.

+1

Включить отладку. В файле 'app/Config/core.php'' 'Configure :: write ('debug', 2)'; –

+0

уже установлен на 2. –

+1

Очистить кеш из tmp \ cache> моделей, постоянных и представлений папки – Salines

ответ

0

Я думаю, что проблема, с которой вы сталкиваетесь, связана с разрешениями. Нижняя ссылка может вам помочь: http://book.cakephp.org/2.0/en/installation.html#permissions

+0

изменил все права доступа к папкам с 0755 по 0777, а теперь вместо пустой страницы я получаю ошибку внутренней внутренней ошибки 500, на всех страницах сайта –

+0

ее папка «приложение», которая не может быть 0777 или я получаю ошибку внутреннего сервера –

+0

Вы не должны изменять все права доступа к папке. Вам просто нужно следовать инструкциям, приведенным в документации. Теперь проверьте журнал ошибок apache для любой ошибки. –

Смежные вопросы