2013-11-14 2 views
-1

cakephp 버전 2.3.6을 사용하고 있습니다. CPanel을 통해 hostgator 서버에 케이크를 업로드하려고했지만 웹 루트에서 index.php 파일을 구성하는 데 문제가 있었지만 올바른 구성이 확실하지 않았습니다. Cpanel에서 케이크의 제 버전 내 cpanel 사용자 이름은 fredenda입니다. 나는 cpanel에서 이것을 설정하려했지만이 에러 메시지를 계속해서 남겼습니다.cPanel 문제를 통해 cakePHP 업로드하기

"구문 분석 오류 : 예기치 않은 구문 오류 ';' in /home/fredenda/public_html/index.php 41 행에 "

그러나이 오류는 파일에 없습니다. 제발 누군가 나를 도울 수 있습니까? 아래 파일을 확인하십시오 ... 축복.

<?php 
/** 
* Index 
* 
* The Front Controller for handling every request 
* 
* PHP 5 
* 
* 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.webroot 
* @since   CakePHP(tm) v 0.2.9 
* @license  http://www.opensource.org/licenses/mit-license.php MIT License 
*/ 

/** 
* Use the DS to separate the directories in other defines 
*/ 
if (!defined('DS')) { 
define('DS', DIRECTORY_SEPARATOR); 
} 

/** 
* These defines should only be edited if you have cake installed in 
* a directory layout other than the way it is distributed. 
* When using custom settings be sure to use the DS and do not add a trailing DS. 
*/ 

/** 
* The full path to the directory which holds "app", WITHOUT a trailing DS. 
* 
*/ 
if (!defined('ROOT')) { 
define('ROOT', DS.'home'.DS.(fredenda); 
} 

/** 
* The actual directory name for the "app". 
* 
*/ 
if (!defined('APP_DIR')) { 
define('APP_DIR', 'app'); 
} 

/** 
* The absolute path to the "cake" directory, WITHOUT a trailing DS. 
* 
* Un-comment this line to specify a fixed path to CakePHP. 
* This should point at the directory containing `Cake`. 
* 
* For ease of development CakePHP uses PHP's include_path. If you 
* cannot modify your include_path set this value. 
    * 
* Leaving this constant undefined will result in it being defined in Cake/bootstrap.php 
* 
* The following line differs from its sibling 
* /lib/Cake/Console/Templates/skel/webroot/index.php 
*/ 

define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib') 

/** 
* Editing below this line should NOT be necessary. 
    * Change at your own risk. 
    * 
    */ 
if (!defined('WEBROOT_DIR')) { 
define('WEBROOT_DIR', basename(dirname(__FILE__))); 
} 
if (!defined('WWW_ROOT')) { 
define('WWW_ROOT', dirname(__FILE__) . DS); 
} 

// for built-in server 
if (php_sapi_name() == 'cli-server') { 
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) { 
    return false; 
    } 
    $_SERVER['PHP_SELF'] = '/' . basename(__FILE__); 
    } 

    if (!defined('CAKE_CORE_INCLUDE_PATH')) { 
if (function_exists('ini_set')) { 
    ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR .   ini_get('include_path')); 
} 
if (!include ('Cake' . DS . 'bootstrap.php')) { 
    $failed = true; 
} 
} else { 
if (!include (CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'bootstrap.php')) { 
    $failed = true; 
} 
} 

경우 (! 빈 ($)는 실패) { 에서 trigger_error은 ("CakePHP의 핵심을 찾을 수 없습니다. APP/웹 루트/index.php에의 CAKE_CORE_INCLUDE_PATH의 값을 확인하십시오. 그것은 당신이 들어있는 디렉토리를 가리켜 야한다 ". DS"케이크 핵심 디렉토리와 ".DS."공급 업체 루트 디렉토리. ", E_USER_ERROR); }

App::uses('Dispatcher', 'Routing'); 

$Dispatcher = new Dispatcher(); 
$Dispatcher->dispatch(
new CakeRequest(), 
new CakeResponse() 
); 

답변

1

눈을 감 으십시오. ;) 파서가 거짓말하지 않습니다.

define('ROOT', DS . 'home' . DS. 'fredenda'); 

내가 적절한와 에디터 나 IDE를 얻기 위해 당신을 추천 할 것입니다 :

define('ROOT', DS.'home'.DS.(fredenda); 

이 라인은해야한다 ...이 누락입니다)하지만 난 fredenda가 일정한 그렇게 생각하지 않습니다 이러한 종류의 구문 문제를 즉시 보려는 PHP 구문 강조 표시 및 구문 검사.

다음을 따라 coding standards을 입력하면 다른 모든 장소와 마찬가지로 DS와 문자열 사이에 공백이 있어야합니다. 또한 좋은 책 "Clean Code"을 읽어보십시오.

+0

그래, 고마워,하지만 나는 cpanel 덕분에 hostgator 서버에 케이크 2.3에 대한 올바른 구성을 알 필요가 있습니다. – user2736201

관련 문제