前提
- WordPressで構築している数年前に外注したコーポレートサイト
- 当時の作成担当者は退職済でドキュメントは残っていない
- テーマにUpstatement社のプラグイン「Timber」のstarter-themeをベースに使用
- サーバーはさくらのレンタルサーバーを使用(サーバー側でのバックアップはとっていなかった)
解決したい問題
- HTTP ERROR 500(Fatal error: Class 'Routes' not found in /社名を伏せるため省略/config/routes.php on line 3)
問題が発生するまでの経緯
1 . headerで発火するプラグインを有効化するため、WordPressのプラグイン管理画面上から
timber-starter-theme/header.phpに{{ function('wp_head') }}
php
1<?php 2/** 3 * Third party plugins that hijack the theme will call wp_head() to get the header template. 4 * We use this to start our output buffer and render into the view/page-plugin.twig template in footer.php 5 * 6 * If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and 7 * WooCommerce) you can delete this file and footer.php 8 */ 9 10$GLOBALS['timberContext'] = Timber::get_context(); 11ob_start(); 12{{ function('wp_head') }} 13
を追加しファイルを更新
2 . HTTP ERROR 500となり、ローカルで保存していた元のphpファイルにさくらのレンタルサーバー上のファイルマネージャーから上書きするもエラーのまま
3 . PHPiniファイルのdisplay_errorsをOFFからONにしエラー内容を
Fatal error: Class 'Routes' not found in /社名を伏せるため省略/config/routes.php on line 3
と特定
4 . 3行目がRoutes::と判明するもここから先の対処方法がわからず困っております。
php
1<?php 2 3Routes::map('/', function($params) { 4 Routes::load('controllers/home/show.php', $params, null, 200); 5});
知見のある方にお力をお借りできますと非常に助かります、何卒よろしくお願いいたします。
あなたの回答
tips
プレビュー