Category: PHP 8.1
-
Post Views: 17 In the process of using WordPress, we will inevitably encounter various errors. One of the most troublesome ones is the seemingly insolvent red screen prompt ‘this site encountered a fatal error’. Although these errors are terrible, as long as they have the correct troubleshooting ideas and tools, most of the problems are subject to rules to follow.…
-
Post Views: 25 Preface In the previous series of articles, I have completed multi-language adaptation of classification, and today I want to solve the most cumbersome part of the entire multilingualization: batch translation of 8060 Chinese labels. Manually add more than 8000 tags to translate one by one? This is obviously unrealistic. After clicking these 8,000 buttons, I am afraid…
-
Post Views: 53 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: 16 1. In PHP, replace some sensitive characters in a string based on preg_replace. One problem that exists is that in its format, a certain string may not exist. Example as follows 2. Why exist the above 3 formats, the reason is that it is generated based on the following code 3. The final code is as follows…
-
Post Views: 18 1. Error:[2024-09-28 02:59:09]local.error: preg_replace(): unknown modifier�{“exception”:”[object](ErrorException(code: 0): preg_replace(): unknown modifier�at) [stacktrace]. as shown in Figure 1 2. Check the code implementation 3. View the printed log information 4. The cause is initially derived, the value of the variable $otherpattern is “province/state caused by “/” caused by “/”. Reference:Regular expression special characters are: . \ + * ?[…
-
Post Views: 17 1. In Spatie\QueryBuilder , the request parameter contains “,” error: sqlstate[HY093]: Invalid parameter number: number of bound variables not match number of tokens (SQL: select count(*) as aggregate from `table` where `table`.`Shipping_type` = 2 and `Shipping_at_gmt` >= 2024-05-21 08:54:14 and `Shipping_at_gmt` <= 2024-08-21 08:54:14 and `table`.`Shipping_error_message in (AAA)). as shown in Figure 1 2. When the request…
-
Post Views: 20 1. Modify the PHP implementation of the table field type 2. However, in Navicat for MySQL, check that there is no change in DDL. Even after closing the connection and closing the database, it is opened again, and it is found that there is still no change. Finally had to close Navicat for MySQL and open it…
-
Post Views: 17 1. Verify the fields that conform to the MySQL field type Decimal(8,2) in Lavavel 9. as shown in Figure 1 2. The final realization is as follows 3. Try respectively: -4 (fail), 0 (success), 5 (success), 999999.99 (success), 999999.990 (success), 999999 .991 (failed), 9999990.99 (fail), 0.09 (success), 0.009 (fail), 0.0000001 (failed), in line with expectations. as shown…
-
Post Views: 63 1. Error: class “vtifulkernelexcel” not found. 2. The reason is that the extension php-ext-xlswriter is not installed. 3. GitHub Release: https://github.com/viest/php-ext-xlswriter/releases download php-windows-xlswriter-cf7e1933-8.1-ts-vs16-x64.zip. as shown in Figure 1 4. After decompression, copy php_xlswriter.dll to C:php-8.1.27extphp_xlswriter.dll 5. Edit php.ini, add extension=xlswriter 6. After restarting php, the error is reported again:[ERROR]workbook_close(): error creatingE:WWWRootObjectStorageAppExport/Order/Order Export Task 2024-02-19 10:24:06.xls. error =…
-
Post Views: 15 1. In Laravel 9, after executing redis::set($this->rules_update_key, carbon::now()); and found that the written value is Object. as shown in Figure 1 2. But in the test environment, the written value is a datetime string. Its value: 2024-01-30 06:00:00. as shown in Figure 2 3. The final comparison found that the root of the difference is that in…