PHP error on the website where the backup data was restored: Parse error: syntax error, unexpected '[', expecting', 'or'; 'in... function.php on line 242

Asked 1 years ago, Updated 1 years ago, 87 views

I am having trouble with a PHP error on the rental server.

After restoring the backup data, only one line of the following appears in the browser.

Parse error: syntax error, unexpected '[', expecting', 'or'; 'in/var/wwww/public_html/sysadmin/common/function.php on line 242

Excerpts from the appropriate file line.

236 function field_name_list()
237 {
238 global $dbh, $mainname, $db_tbl;
239
240 for ($i=0; $i<sizeof($db_tbl); $i++)
241   {
242 global$$db_tbl[$i];
243$in.=$db_tbl[$i];
244 if($db_tbl[($i+1)]!=""){$in.=",;}
245   }
246
247 return $in;
248 }
$php --version
PHP 5.4.16(cli) (build: Oct 30 2018 19:30:51) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright(c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.5, Copyright(c) 1999-2015, by Zend Technologies

After restoring data from automatic backup on the rental server, the page does not appear with a subject error.I have created a website with PHP in the document root and installed WordPress in the document root/blog.

Backup data is one week old.I heard that the website was working then.
Here's what I checked.

This is my first question.Please let me know if anyone has any knowledge.

Screen display and appropriate code excerpts when WordPress DEBUG is turned on

Deprecated: Function create_function() is deprecated in/var/wwww/public_html/blog/wp-includes/pomo/translations.php on line 208

206 function nplurals_and_expression_from_header($header){
207 if(preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/',$header,$matches)){
208$nplurals=(int)$matches[1];
209$ expression=trim($matches[2]);
210 return array ($nplurals, $expression);
211} else {
212 return array(2,'n!=1');
213                         }
214                 }

Deprecated: Function create_function() is deprecated in/var/www/public_html/blog/wp-content/plugins/wordpress-23-related-posts-plugin/init.php on line 440

439 if(!empty($tags)){
440$post_tags='['.implode(',',',array_map(create_function('$v','return'\'.urlencode(substr($v,strpos($v,\'_\')+1)).\';'),$tags).';
441} else {
442$post_tags='[]';
443         }

Notice:Undefined variable: meta_noindex in/var/www/public_html/libs/meta.phponline73

73<?php if($meta_noindex==1 and $blog!=1){?>
74<meta name="robots" content="noindex, follow">
75<?php} elseif($blog!=1){?>
76<meta name="robots" content="index, follow">
77<?php}?>

Notice:Undefined variable:mainname in/var/www/public_html/sysadmin/common/tbl_inc.phponline6

4 switch ($mainname)
5 {
6 case 'member':
7     $db_tbl=array("member_id","name","nickname","sex_cd","mail","password","facebook_user_i        d","facebook_url","role_cd","is_toll","toll_datetime","is_wish_toll","is_temp","zip","pref_        id","address1","address2","tel","url","birth","office_name","is_tel_public","is_mail_magazi        ne","know_cd","login_fail","is_login_lock","is_search","fee_standard_cd","fee_minimum_cd", "fee_skillful_cd", "plan_target_cd_list", "signature_move_cd_list", "skillful_structure_cd_list", "appeal", "img_title_list", "freeword", "view", "is_publish", "public_datet_list", "dat_", "dat_", "indime", "indime", "intime"
8 break;

php cakephp wordpress

2022-09-30 14:42

1 Answers

Self-resolved.

The command said PHP 5.4, but when I checked the server panel of the rental server (Xserver), it was PHP 7.2.

The default PHP version was 7.2 when the domain was initialized.It seems that the source code developed in PHP 5.4 was restored, so an error or warning message was displayed.

Resolved by restoring backed up data again with PHP version 5.4.16.

on the server panel.


2022-09-30 14:42

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.