Home > CMS Tutorial > PHPCMS > phpcms installation cannot connect to the database

phpcms installation cannot connect to the database

angryTom
Release: 2019-11-05 16:41:13
Original
3519 people have browsed it

phpcms installation cannot connect to the database

phpcms installation cannot connect to the database

We are building the phpcms v9 program. When we reach the fifth step, install The program keeps prompting "Unable to connect to the database server, please check the configuration." Let's take a look at how to solve this problem.

Reason:

The phpcms v9 installation program code does not escape special characters (such as: &$^!@#) in the submitted password. If the password contains # or &, it will be incorrectly separated by the $_GET parameter, causing our password to be inconsistent with what we entered, causing problems!

Solution:

1. Modify install/step5.tpl.php 127 behavior:

'&dbpw='+escape($('#dbpw').val())
Copy after login

2. Modify install/step6.tpl. PHP 55 behavior:

var dbpw = escape(&#39;<?=$dbpw?>&#39;);
Copy after login

After the above modification, the problem of being unable to connect to the database is solved.

Recommended tutorial: phpcms tutorial

The above is the detailed content of phpcms installation cannot connect to the database. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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