Home > Backend Development > PHP7 > body text

Solve some common problems of dedecms under php7

藏色散人
Release: 2023-02-17 14:34:02
forward
3853 people have browsed it

1. Unable to obtain error information, a blank

A blank cannot be debugged,

So the first thing to do,

Can output error information.

Open include/common.inc.php

Find the following code

//error_reporting(E_ALL);
error_reporting(E_ALL || ~E_NOTICE);
Copy after login

Change it to

error_reporting(E_ALL);
//error_reporting(E_ALL || ~E_NOTICE);
Copy after login

The main function is to open the error prompt.

2. 'continue' not in the 'loop' or 'switch' context error

You may encounter this error after refreshing

Fatal error: ‘continue’ not in the ‘loop’ or ‘switch’ context in ….include/common.func.php on line 49
Copy after login

The above indicates that there is an error in line 49 of the include/common.func.php file.

Delete continue;

and change it to return;

3. The function mysql_query() is undefined

Mysql_* series functions can no longer be used in php7,

the following error will occur

Fatal error: Uncaught Error: Call to undefined function mysql_query() in ….include/dedesql.class.php:152
Copy after login

php7 requires the use of mysqli or pdo to

communicate with the database, which is

safer and more efficient.

Solution

Open the file data/config.cache.inc.php

$cfg_mysql_type = ‘mysql’;
Copy after login

Change to

$cfg_mysql_type = ‘mysqli’;
Copy after login

4. Left side of the background The menu is blank and does not display. Solution

Method 1

Set the data directory permissions to 777 or 755. Note that it is the entire data directory. Just refresh after setting.

Method 2

Enter data/tplcache, make a backup copy, then delete everything except index.html, then set the data/tplcache directory to 777, and refresh it.

The above is the detailed content of Solve some common problems of dedecms under php7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:lmlyz.online
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!