Category: PHP 7.4
-
Post Views: 24 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: 11 1. When executing: composer install, prompt: enqueue/rdkafka 0.10.19 requires ext-rdkafka -> It is missing from your system. install or enable phps rdkafka extension.. as shown in Figure 1 2. Decide to enable PHP’s RDKAFKA extension. Open:https://pecl.php.net/package/rdkafka/6.0.1/windows, download 7.4 Thread Safe (ts) x64. After decompressing php_rdkafka-6.0.1-7.4-ts-vc15-x64, put php_rdkafka.dll Copy to: C:\php-7.4.27\ext\php_rdkafka.dll. Then edit php.ini, add extension=rdkafka 3. When…
-
Post Views: 15 1. Now you need to take the URI format data from a one-dimensional array. The print result of a one-dimensional array, as shown in Figure 1 2. The implementation is as follows based on the filter_var code, and the printing result is as follows, which does not meet the expectations, which exists: internal://policy_pages/29 3. Obtain the scheme…
-
Post Views: 18 1. Add elements to a specific position in the index array, and now plan to add 2 elements, after price. 2. Based on array_splice — remove a part of the array and replace it with other values, the code is implemented as follows, 3. Print the running results, in line with expectations. as shown in Figure 1…