Tag Archives: The server

PHP php-config is not installed error in ubuntu 16 [How to Solve]

Environment

Ubuntu 16.04.1 LTSPHP 7.0.33

Question

When compiling and installing php extensions with php config, it is found that php-config does not exist.

Check whether php-config exists or not?

$ whereis php-config
php-config:

As above, it returns null, indicating that it does not exist.

Solution:

This problem occurs because the php-dev package is not installed. You can install it once.

Install php-dev

$ apt-get install php-dev

If php5 is version, run apt-get install php5-dev.

re-check php-config

$ whereis php-config
php-config: /usr/bin/php-config /usr/bin/php-config7.0 /usr/share/man/man1/php-config.1.gz

As shown above, the installation is successful.

Failed to start firewalld.service: Unit is masked [How to Solve]

Centos7 failed to start firewall: Failed to start firewalld.service: Unit is masked.

Solution:

The error “Failed to start firewalld.service: Unit is masked.” appears when you run “systemctl start firewalld”. The service needs to be unlocked:

systemctl unmask firewalld.service
systemctl start firewalld

[Solved] Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource

Springboot does not specify the “url” property, and cannot configure an embedded data source. Cause: Unable to determine the appropriate driver class

When you open a new springboot project:

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
    If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
    If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

First, check whether the yml data source configuration file is correct, account password, etc…

I found that there is no resource file in the target file. A closer look shows that there is no icon in the resource file.

Solution:

Step 1: Select the corresponding item and right-click: Open Module Settings

Step 2: Click in sequence according to the corresponding steps, and finally don’t forget to Apply

If other startup errors fail, you can leave a comment!

[Solved] Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60

Guzzle

Error prompt

If an error occurs as follows:

Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/… in xxx.php

The reason is that the local CURL SSL certificate is too old to recognize.

Solution:

  • Download an up-to-date certificate from http://curl.haxx.se/ca/cacert… Then save it to an arbitrary directory.
  • Then put catr.pem in the bin directory of php and edit php.ini, open the php.ini file with notepad or notepad++, about line 1932.
  • Remove the comment “;” in front of curl.cainfo, then write the full path and file name of the cacert.pem certificate at the end, mine is as follows

Finally, restart the wamp.

[Solved] KingbaseES V8R3 Error: cluster.log ERROR: md5 authentication failed

Case description:

In the cluster of KingbaseES V8R3 cluster The error message “ERROR: md5 authentication failed; DETAIL: password does not match” often appears in the log. This case shows the cause of this error.

Applicable version:KingbaseES V8R3

Problem phenomenon:
cluster.log:

Analysis: 1, when the system user connects to port 9999 to execute “show pool_nodes”, you need to access the cluster kingbasecluster service and verify the user’s identity by cluster_password.

As shown below: cluster.log information

2. The password of the system user needs to be verified by the database sys_hba.conf (the password is encrypted by md5).

As shown below: cluster.log information

3. And port 9999 corresponds to the kingbasecluster service, which also needs to be verified by the md5 password in the cluster_password file.

4. If the database password and the password in cluster_password do not match, you cannot log in.

5. This error message does not affect the health detection of the background database by kingbasecluster.

Problem-solving:

When changing the database user system password in the cluster.
        1、Modify the password of the system user in the database.
        2, also need to modify the password of system user in cluster_password by sys_md5 tool. 
        3, you need to modify the password of system in the recovery.done and recovery.conf configuration files.

[Solved] MYSQL Error: ERROR! MySQL server PID file could not be found!

After restarting the MySQL database on the Linux server, various errors were found, causing the MySQL database to fail to work normally.

No matter stop, start or mysql connection, there are different error messages. The specific error messages are:

# service mysqld stop
ERROR! MySQL server PID file could not be found!

# service mysqld start
Starting MySQL.. ERROR! The server quit without updating PID file (/data/mysql/mysql.pid).

# mysql -uroot -p
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

 

1. Error reason:

In fact, the above three different MySQL errors are all caused by one reason: the root directory disk is full.

2. Check the large files that cause the disk to be full:

1. First, use the df command to check the disk usage:
# df
You may see in the output:
/dev/mapper/VolGroup-lv_root 39841176 37788792 28552 100% /

2. Use # du – sh * to view large files. For example, the root directory is data. Use the command to view:
# cd/data
# du – sh *
You will find that the mysql folder occupies more than n gigabytes, and then view which files:
# cd mysql
# du – sh *
You will find many large files, such as
581M mysql-bin.000029
28K mysql-bin.000030
7.6G mysql-bin.000031
4.0K mysql-bin.000032

These files are MySQL Binary Log binary files, which are mainly used for data recovery and master-slave replication of master-slave servers.

Since I have no master and slave servers, I decided to delete them.

3. Solution:

1. Delete these large files:
# rm -rf mysql-bin.000031
~~~

2. After deleting them, open my.cnf under /etc/, find
log-bin=mysql-bin
binlog_format=mixed
Comment out these two lines, that is, add the “#” sign in front:
#log-bin=mysql-bin
#binlog_format=mixed

3. Restart the MySQL server, and it is OK
service mysqld restart

[Solved] KVM Failed to Startup Error: error: Network not found: no network with matching name ‘default‘

An error was reported when starting the KVM virtual machine on the command line: startup failed, and the default network could not be found

[root@localhost ~]# virsh start centos7.0
error: Failed to start domain centos7.0
error: Network not found: no network with matching name 'default'

However, there was a default network before, and an error was reported when it was restarted after a night. First, find the path of default.xml,

[root@localhost ~]# find/-name "default.xml"
/run/libvirt/storage/default.xml
/etc/libvirt/storage/default.xml
/etc/libvirt/storage/autostart/default.xml
/usr/share/backgrounds/default.xml
/usr/share/libvirt/networks/default.xml

It can be seen that there are many xml files. Select those related to network and libvirt for execution

[root@localhost ~]# virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml

[root@localhost ~]# virsh net-start default
Network default started

Start successfully, check:

[root@localhost ~]# virsh net-list
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     no            yes

Finally, just start the KVM virtual machine:

[root@localhost ~]# virsh start centos7.0
Domain centos7.0 started

The graphical interface has also been viewed successfully:

[Solved] Cannot run program “svn” (in directory “D: xxxx”): CreateProcess error=2, the system cannot find the specified file.

 

1. Error content

Cannot run program “svn” (in directory “xxxx”): CreateProcess error=2, the system cannot find the specified file

2. Reason

The command was not installed when TortoiseSVN was installed, so version management cannot be performed through the command

3. Solution

1. Find the TortoiseSVN installation package you downloaded at that time and reinstall it

2. Select the first one here

3. The second option is X, which means that you have not installed the command. Click on and check the first one, and then confirm the next step

SqlSugar Connect MySql 8.0.29 Error [How to Solve]

1. Background

I exported the database table structure and data from the company server Mysql (version: 8.0.16) and restored it to my local computer Mysql (version: 8.0.29). Just after starting the project, I was prompted with a SqlSugar database connection error. The prompt error is as follows:

Execute Db.Ado.CheckConnection() reports an error
Connection open error . The given key ‘0’ was not present in the dictionary.

note: the connection string: database=stocks;server=127.0.0.1;port=3306;uid=root;pwd=123;

The following is the error report problem of individual table query.

DB.Queryable().Where(p=>true).ToList() error. ToList() error, after analysis, the main problem is the current table field character set and sorting rules are not uniform. The error is reported as follows.
MySqlException: “Fatal error encountered attempting to read the resultset.”
Internal exception MySqlException: Expected end of data packet

2. Solution

1. Solution to connection error

Add charset=utf8mb4, and the connection will no longer report errors note: if you want utf8mb4, I use utf8 locally and still report an error

database=stocks;server=127.0.0.1;port=3306;uid=root;pwd=123;charset=utf8mb4;

2. Modify the inconsistency of database character set

Execute the following SQL script as required.

(1) Change the encoding (character set) of a table and the encoding (character set) of all fields in the table:

ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
·TABLE_NAME replace to your table name.

(2) Change the encoding (character set) of all tables and the encoding (character set) of all fields in the table:

SELECT
	CONCAT(
		'ALTER TABLE ',
		TABLE_NAME,
		' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'
	)
FROM
	information_schema.`TABLES`
WHERE
	TABLE_SCHEMA = 'DATABASE_NAME';
·DATABASE_NAME replace to your databese name.

3. Other contents

Query all table names of a database:

SHOW FULL COLUMNS FROM TABLE_NAME;
·TABLE_NAME replace to your table name.

[Solved] tp6.0 open_basedir Error: Warning: require(): open_basedir restriction in effect.

Error message

Warning: require(): open_basedir restriction in effect. File(/work/tp6/vendor/autoload.php) is not within the allowed path(s): (/work/tp6/public/:/tmp/) in /work/tp6/public/index.php on line 15

Warning: require(/work/tp6/vendor/autoload.php): failed to open stream: Operation not permitted in /work/tp6/public/index.php on line 15

Fatal error: require(): Failed opening required '/work/tp6/public/../vendor/autoload.php' (include_path='.:') in /work/tp6/public/index.php on line 15

 

Check the problem description and data, and find that it is the problem of PHP open_basedir  configuration is that PHP cannot import the files above the authorized directory;

In general, this problem will not occur. The reason for this problem is mostly due to the server. This restriction is made for security!

If the entry file of is switched to public, the following file should be modified to remove public

Solution: