Category: Programming Language
-
Post Views: 16 1. Report an error in PHP 7.4: header() expects at least 1 parameter, 0 given. as shown in Figure 1 2. Check the specific code implementation 3. Print the $fields , the result is as follows 4. Add judgment, when $field is equal to name, print $FieldResolvers[$field], is_callable($fieldResolvers[$field]) 5. is_callable — Verify that the value can be…
-
Post Views: 15 1. In the MySQL table, the field type is JSON, and it is allowed to be null. as shown in Figure 1 2. Since only is_null() is judged in the program, if it is not null, the default is json format. When its value is String(4) “NULL”, the program throws a 500 exception. Displayed as null, indicating…
-
Post Views: 16 1. For the same GraphQL API request, it sometimes responds to 500 in the browser, and there is no response data, and sometimes the response is 200, and there is a response data. as shown in Figure 1 2. When the response is 500, there is no response data. Decide to set the error level to output…
-
Post Views: 25 1. Reference: In Laravel 6, based on ZipStream PHP, stream the zip file to the S3 bucket. Reference: Generate a stream resource based on Fopen in PHP 7.4, operate the disk, and adjust it to a memory-based implementation. The compression and decompression is successful based on 360, and the decompression based on WinRAR fails. as shown in…
-
Post Views: 17 1. In Laravel 6, ThemeInstallation::IscodeEdited must return a relationship instance.. as shown in Figure 1 2. View the method in the model file 3. Finally found the reason, $theme->ThemeInstallation->iscodeEdited needs to add ()
-
Post Views: 19 1. Adding fields to a table takes 180 seconds. as shown in Figure 1 2. The total number of records in the query table is: 173816. as shown in Figure 2 3. Decide to allow the newly added field to be null, and add the field again, which takes 104 seconds. as shown in Figure 3 4.…
-
Post Views: 19 1. In PHP 7.4, when using file_put_contents, an error is reported: Failed to open stream: no such file or directory. as shown in Figure 1 2. The reason is the file name: theme-cdn-config-2023-02-23-10:23:19.txt format is incorrect, it contains :, replace : with -, run again, no errors are reported.
-
Post Views: 20 1. In the container, when the environment variable is obtained for the first time, the configuration value of the production environment is obtained, or it is not obtained (set in the program, when the environment variable is not set, the default setting is the configuration value of the production environment). When the environment variable is obtained for…