PHP-fpm이 안됩니다

Extra Form
PHP PHP 7.3
CMS Rhymix 2.0

https://tecadmin.net/setup-nginx-php-fpm-on-ubuntu-20-04/

위 글을 보면서 따라했는데 제 사이트에 접속해보면 

 

<?php
/**
 * -----------------------------------------------------------------------------
 * 
 *        R H Y M I X  :  C O N T E N T  M A N A G E M E N T  S Y S T E M
 * 
 *                            https://www.rhymix.org
 * 
 * -----------------------------------------------------------------------------
 * 
 *  Copyright (c) Rhymix Developers and Contributors <[email protected]>
 *  Copyright (c) NAVER <http://www.navercorp.com>
 * 
 *  This program is free software: you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the Free
 *  Software Foundation, either version 2 of the License, or (at your option)
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but WITHOUT
 *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 *  more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 * 
 * -----------------------------------------------------------------------------
 * 
 *  Rhymix is a derivative work of XpressEngine (XE) version 1.x.
 *  The license has been changed from LGPL v2.1 to GPL v2 in accordance with
 *  section 3 of LGPL v2.1. This change is irreversible and applies to all of
 *  Rhymix, including parts that were copied verbatim from XpressEngine.
 * 
 * -----------------------------------------------------------------------------
 */

/**
 * Include the autoloader.
 */
require __DIR__ . '/common/autoload.php';

/**
 * @brief Initialize by creating Context object
 * Set all Request Argument/Environment variables
 **/
Context::init();

/**
 * @brief Initialize and execute Module Handler
 **/
$oModuleHandler = new ModuleHandler();
$oModuleHandler->init() && $oModuleHandler->displayContent($oModuleHandler->procModule());

Context::close();

/* End of file index.php */
/* Location: ./index.php */
 

 

텍스트파일이 다운받아집니다. PHP fpm이 문제가 아닌가요?

 

Screenshot 2022-11-08 212046.png

 

위 사진은 /etc/nginx/sites-available/example.com 디렉토리입니다

  • profile

    아까 다른 질문글을 보면 example.com 말고 사이트 설정 파일이 하나 더 있었던 것 같은데요. 님이 다른 데서 구해다가 붙이셨다가 에러났던 rhymix 파일이요. 그 파일명을 example.com으로 바꾸신 건가요? 아니면 다른 파일인가요?

     

    아무튼 실제로 님 사이트를 담당하는 (라이믹스와 관련된 설정이 들어가 있는) 파일에도 PHP 연동 코드가 똑같이 들어가 있는지 확인하고, 필요하면 수정 후 nginx를 재시작해 보세요.

     

    대개 PHP-FPM 연동 과정에 오류가 있으면 (버전이 틀리다거나 경로가 틀리다거나) 502, 504 등의 에러코드가 뜨곤 합니다. 에러도 안 나고 소스가 그대로 다운받아지는 것은 nginx가 아예 연동 시도조차 안 하고 있는 거예요. 즉, 보고 계신 파일 말고 다른 파일을 수정해야 할 가능성이 높습니다. 파일명은 서버 세팅 방법이나 버전마다 다를 수 있기 때문에 인터넷에 나오는 글을 그냥 따라하면 안되고, 님 상황에 맞춰서 적절히 응용하셔야 해요.

  • profile ?
    감사합니다
  • profile

    설마 "example.com"을 그대로 쓰지 않고 (당연히) 본인이 보유한 도메인으로 바꾸었겠죠? 안바꾸었으면, 저 conf가 아닌 default 설정으로 가버렸을 것 같습니다~ ㅎㅎㅎ

    도메인 구입 안했는데 연습삼아서 연결하려면 (80 포트로 접속), 서버의 /etc/hosts 파일에 해당 도메인과 ip를 강제로 지정해줄수는 있습니다. 접속하는 클라이언트 PC/맥의 hosts 파일에도 도메인과 (서버) ip를 지정하면 그 도메인은 거기로 접속이 되겠죠.

     

    PS: 구글 클라우드가 트래픽 비용이 비싸서 재벌 아니면 쓰기 힘든데말이죠. TB당 $85~$120 (12~16만원) 정도니까요.

  • profile ?
    감사합니다