php7 is not compatible with dedecms
1. Unable to obtain the error message, a blank, a blank is It cannot be debugged, so the first thing to do is to be able to output error messages.
Open include/common.inc.php
Find the following code
//error_reporting(E_ALL); error_reporting(E_ALL || ~E_NOTICE);
and change it to
error_reporting(E_ALL); //error_reporting(E_ALL || ~E_NOTICE);
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
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 not defined
Mysql_* series functions can no longer be used in php7, and the following error will occur
Fatal error: Uncaught Error: Call to undefined function mysql_query() in ….include/dedesql.class.php:152
In php7, you need to use 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’;
and change it to
$cfg_mysql_type = ‘mysqli’;
4. The left menu in the background is blank and does not display the 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.
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of php7 is not compatible with dedecms. For more information, please follow other related articles on the PHP Chinese website!