Category: Programming Language
-
Post Views: 52 1. My personal blog suddenly responded to 504’s investigation and resolution process today. as shown in Figure 1 2. 504 Gateway Timeout Description Nginx (or other reverse proxy) waits for the backend (PHP-FPM) response timeout. Check in the following order: 3. Execute the top command, the result is shown as follows: The problem is very clear, and…
-
Post Views: 28 1. The same piece of code is effective in local Windows, but it is invalid for troubleshooting and analysis in the Linux environment. The code is as follows 2. In the Linux system of the production environment, the code if ($item->order_number != $neworderNumber) { } has not been executed. order_number=17, expected to be order_number=16. As shown in…
-
Post Views: 23 1. Due to the front-end, the same page, for mobile devices and desktop devices, is a separate page. Therefore, you need to detect whether it is a mobile device in PHP 7.4, which in turn renders different template files 2. Reference:mobile-detect . Only the latest version of 3.* can be used, because PHP 7.4 is now used,…
-
Post Views: 19 1. The result of preg_split after executing Chinese is garbled. as shown in Figure 1 2. Convert the string to UTF-8 before using preg_split(). u means Unicode (UTF-8) mode, avoiding Chinese character split errors. 3, the split is correct, no more errors.
-
Post Views: 16 1. Request an HTTPS URL in curl, and the response is False’s troubleshooting analysis. var_dump($rst), whose value is false 2. Configure openssl.cafile in php.ini. False no longer responds after restarting php-fpm
-
Post Views: 23 1. Error report: call to undefined function common\models\exif_imageType error indicates that php cannot find the EXIF_IMAGETYPE function. EXIF_IMAGEType is a function in the EXIF extension of PHP to detect the type of image file. This error is caused if the extension is not installed or enabled. 2. In LNMP 2.1, install and enable the PHP EXIF extension…
-
Post Views: 17 1. The interface response is 500. as shown in Figure 1 2. Check the error log of nginx. Error report: php message: php warning: require(): open_basedir restriction in effect. file(/home/wwwroot/object/src/vendor/autoload.php) is not within the allowed path(s): as shown in Figure 2 3. Reference:lnmp add and delete virtual host and pseudo-static use tutorial to prevent cross-directory settings View…
-
Post Views: 21 1. When logging in in phpMyAdmin, prompt: mysqli::real_connect(): The server requested authentication method unknown to the client[caching_sha2_password]. as shown in Figure 1 2. Starting with MySQL 8.0, the default authentication method is changed from MYSQL_Native_password to caching_sha2_password. While this new approach is more secure, older versions of PHP (before 7.4) and some MySQL client libraries do not…
-
Post Views: 85 1. In the performance environment, the list interface response timeout. as shown in Figure 1 2. Determine the sql of the interface to execute, connect the mysql of the performance environment in the local environment, and then view the generated sql in Laravel Telescope, and find a select count(*) as aggregate FROM is much longer than other…