Tag Archives: server

[Solved] PHP Error: Warning: file_get_contents(): Failed to enable crypto

I. Description
file_get_contents() error when reading https content

II. Reason
Local service is not configured ssl certificate, can not get the contents of the path to https

III. Solution
1, Linux server configuration https ssl certificate.
Linux server configuration https ssl certificate.
2. curl_ request to obtain the content (see the following method curlGet ())

    /**
     * get the content
     * @param $url
     * @return bool|string
     */
    function curlGet($url)
    {
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36');
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        $content = curl_exec($ch);
        curl_close($ch);
        return ($content);
    }

3.Use file_get_contents() function to skip https authentication

        $streamOpts = [
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false
            ]
        ];
        $html = file_get_contents($pageUrl, false, stream_context_create($streamOpts));

[Solved] svn Error: E230001: Server SSL certificate verification failed: certificate issued

svn: E230001: Server SSL certificate verification failed: certificate issued

means that the server’s SSL certificate verification failed.

Solution:

In the terminal, Execute svn ls https://*/svn/ (my project address)

Then the terminal will ask you to choose R, t, or p, p for accept

We enter p and press Enter,then you will be prompted to enter the computer user’s password and svn account password,just follow the prompts

After all input is complete, Press Enter

[Solved] Job for mysqld.service failed because the control process exited with error code

When closing the virtual machine, and then reopening the virtual machine, The following error will appear when executing the command systemctl start mysqld to start the mysql service: Job for mysqld.service failed because the control process exited with error code. See “systemctl status mysqld.service” and “journalctl -xe” for details.
 Insert picture description here
The above situation occurs because the virtual machine is shutting down, mysql service-related control process error, After my own learning and experience, I got a solution: First enter the specified directory/run, create a mysqld file in this directory, Then authorize this file, In this way, the mysql service can be started normally
Insert picture description here
In fact, when we install mysql, start When mysql service, use the command systemctl enable mysqld to set the boot to start automatically, the above error will not occur.

[Solved] NTP Sync common error: no server suitable for synchrnization found

Project Scene:

Environment centos7.9


Problem description

Set a server as ntp server. The other is the client. Found an error. no server suitable for synchrnization found

Use: ntpdate -d 10.143.33.50

View the error

xxx.xxx.xxx.xxx: Server dropped: no data

Appears again during debugging

xxx.xxx.xxx.xxx: server dropped: strata too high


Cause Analysis:

1. Keepalived was originally installed on the server. I thought it was because of this effect. After closing it, the problem is still there.

2,–check from the server side
[root@timeserver ~]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
210.72.145.44 .ACTS. 1 u 971 8 0 0.000 0.000 0.000
202.120.2.101 .INIT. 10 u 8 64 377 0.000 0.000 0.000

Viewing is normal.

3, there may be network reasons

4. From the data, it is also related to conf. configuration , configuration such as restrict


Solution:

1. Make sure port 123 is connected

2. Modify the server configuration (202.120.2.101 This is the synchronization server)

vim /etc/ntp.conf

restrict default nomodify notrap noquery
restrict 127.0.0.1
server 202.120.2.101 prefer
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var /lib/ntp/drift
keys /etc/ntp/keys

3. Restart ntpd on the server side

service ntpd restart

[Solved] KeyCloak users check their profile error: “failed to initialize keycloak”

Whether it is an administrator, or a newly added Realm user, after logging in, checking your own account, will report the error failed to initialize keycloak, and cannot borrow KeyCloak The interface can modify the password and update personal information by itself.

Solution:

Modify the web orgine whose client name is account-console, add *

Refer to here

[Solved] yum Install gcc Error: Error: Package: glibc-headers-2.17-317.el7.x86_64

When installing Nignx
Installing the GCC compiler

yum install -y gcc

Report an error as below:

Error: Package: glibc-headers-2.17-317.el7.x86_64 (base)
           Requires: glibc = 2.17-317.el7
           Installed: glibc-2.17-322.el7_9.i686 (@c6-update)
               glibc = 2.17-322.el7_9
           Available: glibc-2.17-317.el7.i686 (base)
               glibc = 2.17-317.el7
Error: Package: glibc-devel-2.17-317.el7.x86_64 (base)
           Requires: glibc = 2.17-317.el7
           Installed: glibc-2.17-322.el7_9.i686 (@c6-update)
               glibc = 2.17-322.el7_9
           Available: glibc-2.17-317.el7.i686 (base)
               glibc = 2.17-317.el7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Show one installed version higher than the required version

Resolved by downgrading.

yum downgrade glibc glibc-devel glibc-common glibc-headers

Installation success!

Installed:
  gcc.x86_64 0:4.8.5-44.el7                                                                                                                                           

Dependency Installed:
  cpp.x86_64 0:4.8.5-44.el7 glibc-devel.x86_64 0:2.17-317.el7 glibc-headers.x86_64 0:2.17-317.el7 kernel-headers.x86_64 0:3.10.0-1160.el7 libmpc.x86_64 0:1.0.1-3.el7
  mpfr.x86_64 0:3.1.1-4.el7

Complete!

[Solved] Gerrit Error: Permission denied publickey

Gerrit reports an error: permission denied solution

Foreword solution

Foreword

When using the Gerrit clone code, you will find an error. The error message is probably: permission denied (publickey)

openssh has abandoned RSA encryption keys since version 8.8 for security reasons
openssh thinks that RSA cracking costs too little, so it is disabled if there is a risk
you can use the command:
ssh -v [git server]

Check the openssh version number of the Gerrit server.
if it is ≥ 8.8, you can use this method.

Solution

Enter the machine SSH directory,
create a new config file without suffix:

The content is:

Host gerrit's IP or domain name
HostName gerrit's IP or domain name
User Gerrit's user name (e.g. zhangsan)
PubkeyAcceptedKeyTypes +ssh-rsa
IdentityFile ~/.ssh/id_rsa
Port 29418 (Gerrit port)

Once configured, the clone is OK. Generally, there is no problem.

[Solved] Tomcat Error: org.apache.tomcat.util.digester.Digester.fatalError Parse fatal error at line [40] column [36]

Error Messages:

org.apache.tomcat.util.digester.Digester.fatalError Parse fatal error at line [40] column [36]
org.xml.sax.SAXParseException; lineNumber: 40; columnNumber: 36; The value of attribute “password” associated with an element type “user” must not contain the ‘<‘ character.

Solution:
apache-tomcat-10.0.12\conf\tomcat-users

  <user username=”admin” password=”admin” roles=”manager-gui”/>
<user username=”robot” password=”<must-be-changed>” roles=”manager-script”/>
<user username=”tomcat” password=”admin” roles=”tomcat”/>
<user username=”both” password=”<must-be-changed>” roles=”tomcat,role1″/>
<user username=”role1″ password=”<must-be-changed>” roles=”role1″/>

Change password, e.g.
<user username=”robot” password=”admin” roles=”manager-script”/>

Git bash error, version 2.16.2-64-bit

Environment: Win7 64-bit
Error: Could not fork child process: Resource temporarily unavailable (-1).
DLL rebasing may be required; See ‘rebaseAll/rebase — help’.
 
Failed to fork child process no such file or directory, DLL rebasing may be required
 
Solutions:
1. Go to the Git installation directory and run git-cmd.exe;
2, Execution command: CD usr/bin, enter /bin directory;
3, Execute command: CP MSYS-2.0. DLL.. /, copy msys-2.0.dll to the directory above;
Rebase-b 0x76000000… rebase-b 0x76000000…/msys – 2.0. DLL
Rebase-b 0x30000000… rebase-b 0x30000000…/msys – 2.0. DLL
6, Execute command: cp.. /msys-2.0.dll. Copy msys-2.0.dll back to /bin current directory (.. Represents the current directory)
 
Rerun git-bash.exe, problem solved!
 
If the problem persists, try modifying the registry:
1. Open Run and type regedit to open the registry
[HKEY_CLASSES_ROOT \ DIRECTORY \ BACKGROUND \ SHELL \ GIT_SHELL \ COMMAND] :\Program Files\Git\git-bash.exe
3, Replace it with C: Program Files\Git\bin\sh.exe
 
 
 

Resolve the problem of “event ID 4107” or “event ID 11” errors recorded in the application logs of windows and windows server

Problem description
An error similar to the following was logged in the application log on a machine running Windows 7 or Windows Server 2008 R2:
Log name: application
source: microcosm-windows-capi2
date: date and time
event ID: 4107
task category: no
level: error
key words: classic
user: N/A
computer: computer name
description:
from < http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab (http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab) > The automatic update CAB failed to extract the third-party root list with the error: the certificate required for verification based on the current system clock or the timestamp in the signature file is not valid.
Or, an application log on a machine running Windows Vista or Windows Server 2008 records an error similar to the following:
Log name: application
source: microcosm-windows-capi2
date: date and time
event ID: 11
task category: no
level: error
key words: classic
user: N/A
computer: computer name
description:
from < http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab (http://www.download.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab) > The automatic update CAB failed to extract the third-party root list with the error: the certificate required for verification based on the current system clock or the timestamp in the signature file is not valid.
why
The above error occurred because the Microsoft Certificate Trust List publisher certificate has expired. A copy of the CTL whose signature certificate has expired exists in the CryptnetUrlCache folder.
In addition, the event ID 4107 May be logged as a “data invalid” error rather than a “Certificate that is not valid when verified against the current system clock or timestamp in the signature file” error.
The solution
Our Fix IT team has provided you with an automated solution to help you solve this problem. You can download or run the solution directly by clicking the following picture or the “Fix it to help me solve this problem” text link:

Let Fix IT help me Fix this problem
Further reading
If you would like to learn more about this problem or try to solve it yourself manually, please refer to the technical articles on the Microsoft website:
http://support.microsoft.com/kb/2328240