CodeIgniter2を利用した古い送信フォームをバージョンアップするため、テスト環境を構築していますが、
環境構築中に以下のエラー(というかNotice)メッセージが発生しました。
なにぶんCodeIgniter自体を触るのが初めてなこともあり、様々な記事を参照していますが
/System 側のファイルのエラーということもあるので、
そもそもindex.phpにおけるパスの指定が何か間違っているのかとも考えております。
###発生している問題・エラーメッセージ
エラー1
A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257
エラー2
A PHP Error was encountered Severity: Notice Message: Only variables should be assigned by reference Filename: core/Loader.php Line Number: 74
###該当のソースコード
エラー1の該当function
PHP/CodeIgniter
1/** 2* Loads the main config.php file 3* 4* This function lets us grab the config file even if the Config class 5* hasn't been instantiated yet 6* 7* @access private 8* @return array 9*/ 10if ( ! function_exists('get_config')) 11{ 12 function &get_config($replace = array()) 13 { 14 static $_config; 15 16 if (isset($_config)) 17 { 18 return $_config[0]; 19 } 20 21 // Is the config file in the environment folder? 22 if ( ! defined('ENVIRONMENT') OR ! file_exists($file_path = APPPATH.'config/'.ENVIRONMENT.'/config.php')) 23 { 24 $file_path = APPPATH.'config/config.php'; 25 } 26 27 // Fetch the config file 28 if ( ! file_exists($file_path)) 29 { 30 exit('The configuration file does not exist.'); 31 } 32 33 require($file_path); 34 35 // Does the $config array exist in the file? 36 if ( ! isset($config) OR ! is_array($config)) 37 { 38 exit('Your config file does not appear to be formatted correctly.'); 39 } 40 41 // Are any values being dynamically replaced? 42 if (count($replace) > 0) 43 { 44 foreach ($replace as $key => $val) 45 { 46 if (isset($config[$key])) 47 { 48 $config[$key] = $val; 49 } 50 } 51 } 52 53 return $_config[0] =& $config; 54 } 55}
最後のreturn $_config[0]=& $config; でNoticeが出ています。
エラー2の該当function
/** * Set _base_classes variable * * This method is called once in CI_Controller. * * @param array * @return object */ public function set_base_classes() { $this->_base_classes =& is_loaded(); return $this; }
$this->_base_classes =& is_loaded();の行がNoticeとして出ています。
###試したこと
index.phpの$system_pathと$application_folderを
ルートからの絶対パスで指定しています。
その他はデフォルトのままとなっております。
他、PHPの古い記述で「<? (コードの記述)~」となっているところは
「<?php (コードの記述)~」と直しています。
###補足情報(言語/FW/ツール等のバージョンなど)
CodeIgniter 2
PHP5.6.31
Zend Engine 2.6.0使用
Nginx
外注に依頼したもののようで、ドキュメントは残っていないようです。
他に必要な情報、ご不明な点等ございましたらご質問くださいませ。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。