Category: Yii

  • Post Views: 14 1. In the domain name:http://editorweb.wjdev.chinamcloud.cnInterface in request:http://api.pcs.wjdev.chinamcloud.cn/v1/plan-tasks/274?login_id=2e368664c41b8bf511bcc9c65d86dbc3&login_tid=b26398238620e8cd15b0155cd7aee9b2, in response to 404 , the “Access-Control-Allow-Origin” header does not exist on the requested resource. as shown in Figure 1 Decide to implement a front-end AJAX request example in the local environment by yourself 3, POST request, response 200, but no response data. as shown in Figure 2 4. Refer to the cross-domain resource sharing CORS mechanism:https://www.yiiframework.com/doc/guide/2.0/zh-cn/structure-filters#cors, add the Cross-Origin Resource Sharing filter to the controller 5. POST request again, in response to 200, the console in the browser successfully outputs the code of the response data. Figure 3, Figure…

  • Post Views: 19 1. In Postman, the details of the specified resource of the GET request, the response is 200, as shown in Figure 1 2. Check the routing configuration, the code is as follows 3. Check the controller, the code is as follows 4. Details of the specified resource for the POST request in Postman, the response is 404, as shown in Figure 2 5. Adjust the routing configuration, get /plan-tasks/79 and post /plan-tasks/79: return the details of resource ID 79 6. POST requests the details of the specified resource in Postman, the response 405, the method that is…

  • Post Views: 13 1. When executing the Composer Update, the prompt: Package Codeception/Base is abandoned, you should avoid using it. No Replacement was Suggested., as shown in Figure 1 2. Since I am using the Yii 2 advanced project template, look at composer.json on github, and find that there are no dependencies: codeception/base, refer to:https://github.com/yiisoft/yii2-app-advanced/blob/2.0.35/composer.json, as shown in Figure 2 3. In the local environment, composer.json is still dependent: codeception/base, as shown in Figure 3 4. Change the composer.json file to match the composer.json on github 5. Execute the Composer Update again to update the development dependency to the latest…

  • Post Views: 14 1, CMCConsoleUser/ActionSync, existing implementation, reference:https://www.shuijingwanwq.com/2020/03/02/3964/, now need to add parameters: tenant ID 2. The parameter will be passed to the action method corresponding to the requested subcommand. Set the default value of the parameter $groupid to null 3. Determine whether the $groupId is empty, if it is not empty, and it does not exist in $HttpCMCAPiGroupIds, it successfully exits 4. Based on the chronological arrangement of the last synchronization, assign the value to: $sortcmCapiGroupIds, the array before and after printing the sorting 5. Now it is necessary to synchronize the users under this tenant based on the…

  • Post Views: 13 1. The request interface, the total number of resources in the response parameters is 30. Resources containing ids equal to 37918 are duplicates. A total of 2. as shown in Figure 1 2. Check the model class, /common/models/redis/cmc_console/user.php 3. Check /common/components/redis/activerecord.php , which defines the prefix and applies to all AR keys. 4. Open RedisDesktopManager, check the total number of users, and determine it to 29, as shown in Figure 2 5. Open RedisDesktopManager, and determine that the primary key value is 37918 to be 1, which is not repeated. as shown in Figure 3 6. Check…

  • Post Views: 11 1. When multiple database connection components have been added in Yii 2.0 2. The strategy to migrate multiple databases is to store the migration to different directories. A connection component corresponds to a directory. DB directory: /console/migrations/. Directory of statdb: /console/migrations/stat_db/. as shown in Figure 1 3. When generating the migration file under statdb, you need to specify: –migrationpath=@console/migrations/stat_db/ , as shown in Figure 2 4. Then you can migrate different databases through the following commands. The first command will submit the migration under the /console/migrations/ directory to the db database, and the second command will submit…

  • Post Views: 17 1. When multiple database connection components have been added in Yii 2.0 2. When statdb is selected for the database connection ID, only the data table under statdb will appear in the drop-down list of the table name, as shown in Figure 1 3. When the model file under statdb is generated, getdb() is additionally generated, as shown in Figure 2 4. When DB is selected for the database connection ID, the data table under dB does not appear in the drop-down list of the table name. Therefore, you need to fill in the corresponding information manually.…

  • Post Views: 15 1. Edit .gitignore and add /vendor to the git warehouse, as shown in Figure 1 2. Failed to build in Jenkins, check Console output. as shown in Figure 2 3. Docker deployment, delete the composer install. Edit Dockerfile. as shown in Figure 3 4. Build successfully in Jenkins. as shown in Figure 4 5. Failed to start in Rancher, check the log. as shown in Figure 5 6. Edit build/c_files/config/init/console_init.sh. Delete the related commands for $PCS_API_CFG_MIGrate == “true”. as shown in Figure 6 7. Start successfully in Rancher, check the log. as shown in Figure 7 8.…

  • Post Views: 14 1. Nginx + php-fpm in the case of Windows 10, when in a request (http://api.channel-pub-api.localhost)中curl another request (http://api.channel-pub-api.localhost)时,报错:fopen(http://api.channel-pub-api.localhost/qq/v1/articles/standard?group_id=015ce30b116ce86058fa6ab4fea4ac63):Failed to open stream: HTTP request failed! . as shown in Figure 1 2. Edit the Nginx configuration file and copy the server: API to the server: localhost API. Adjust Listen 81, server_name localhost, fastcgi_pass 127.0.0.1:9001. A total of 3 configuration values. Figure 2, Figure 3   3. Open a new PowerShell window and execute php-cgi.exe -b 127.0.0.1:9001-c c:/php-7.2.14/php.ini, as shown in Figure 4 4. Nginx + php-fpm in the case of Windows 10, when in a request (http://api.channel-pub-api.localhost)中curl another…

👨‍💻 Personal Brand

Wang Shiqiang | PHP & Go Technical Consultant

15+ years of backend development experience specializing in system maintenance, architecture optimization, performance tuning, and Linux administration.

Technical blogger since 2013 with 1,000+ original articles.

Available for consulting, long-term maintenance, and remote collaboration.

👉 About Me & Contact

.env (14) 404 (13) add (17) Aliyun (19) Apache (13) Array (19) browser (14) Cache (13) CentOS (23) chrome (18) Client (11) command line (13) composer (42) composer.json (22) composer install (13) composer update (14) console (14) Container (25) curl (15) Database (11) database migration (16) delete (32) Docker (31) Dockerfile (15) ECS (12) environment variable (20) error (24) escape (12) Failed (13) file (16) filter (20) fopen (11) FORMAT (12) function (13) Git (27) GitHub (16) Gitlab (15) Go (34) Go 1.26 (12) GraphQL (24) GraphQL API (14) hosts (11) http (21) https (20) Installation (13) Interface (19) Jenkins (12) Jquery (13) json (24) Laravel (36) Laravel 6 (56) Laravel 9 (25) Lighthouse (17) Lighthouse 5 (14) Linux (15) Memory (11) Migrate (13) Migration (11) Module (17) MySQL (76) MySQL 5.7 (21) Nginx (45) Node.js (12) normalize.css (29) OKX (15) PHP (63) php.ini (24) PHP 7.1.12 (22) PHP 7.4 (26) phpmyadmin (15) PhpStorm (24) Polylang (24) postman (18) Query (17) queue (16) Rancher (24) Redis (38) Refactoring (12) require (12) response (13) RESTful (27) RESTful API (23) rules (12) setting (12) Shell (13) Shopify (19) Shopify CLI (12) SQL (24) String (15) TortoiseGit (15) Ubuntu (35) update (20) VPN (13) Windows 10 (46) WireGuard (22) WordPress (48) Wstunnel (11) Yii (40) Yii 2 (70) Yii 2.0 (51)

June 2026
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930