


How to fix 404 errors encountered when deploying a ThinkPHP 6 project on port 8088 via Nginx on Ubuntu?
Apr 01, 2025 pm 12:33 PMUbuntu system Nginx deploys ThinkPHP 6 project, 8088 port 404 error check
When deploying PHP projects using Nginx on Ubuntu, especially when listening for non-standard ports (such as 8088), you often encounter 404 errors. This article will analyze in detail the 404 problems encountered when deploying ThinkPHP 6 projects on port 8088 through Nginx on Ubuntu and provide solutions.
Problem description
On Ubuntu systems, using Nginx to deploy ThinkPHP 6 project to port 8088, accessing any interface or files under public directory will return a 404 error. The Alibaba Cloud Security Group has released port 8088.
Nginx configuration file
Configuration file under conf.d (xxx.conf):
server { listen 8088; server_name your server IP address; # Please replace it with your server IP root /path/to/your/project/public; # Please replace it with your project's public directory path index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; # simplify try_files directive} location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; # Please check whether the php-fpm socket path is correct fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Use the standard parameter name include fastcgi_params; } }
nginx.conf file (some key configurations):
user www-data; worker_processes auto; # ... other configurations ... include /etc/nginx/conf.d/*.conf; # ... other configurations ...
Solution
Configuration file syntax check: Use
nginx -t xxx.conf
to check configuration file syntax errors. If there is any error, modify and re-run the command. Then executesystemctl reload nginx
orservice nginx reload
to restart the Nginx service.Local testing: Use
curl 127.0.0.1:8088
on the server to test whether it is accessible. If you can access it, it means that the Nginx configuration is basically correct, and the problem may be in the external network configuration of the server or the firewall.-
Network configuration and firewall:
- Firewall: Confirm whether Ubuntu firewall (such as UFW) allows access to port 8088. You can use
sudo ufw allow 8088
to allow access, and thensudo ufw status
to view the status. - Alibaba Cloud Security Group: Check the Alibaba Cloud Security Group rules carefully again to ensure that the entry direction rules for port 8088 are correctly configured and allow your client IP address to access.
- Firewall: Confirm whether Ubuntu firewall (such as UFW) allows access to port 8088. You can use
php-fpm socket path: Ensure that the
/var/run/php/php7.4-fpm.sock
path is correct and is consistent with the configuration of php-fpm. Check whether the php-fpm service is running normally.Permissions issue: Check whether the Nginx user (www-data) has read execution permissions for the project directory and its files.
ThinkPHP 6 routing configuration: Check whether the routing configuration of the ThinkPHP 6 project is correct to ensure that the request can be processed correctly.
Log check: Check Nginx error log
/var/log/nginx/error.log
nginx/error.log to see if there is more detailed error information.
If the above steps still fail to resolve the problem, please provide the following information for further troubleshooting:
- Server operating system version
- Nginx version
- PHP version
- php-fpm configuration
- ThinkPHP version 6
- Complete Nginx error log content
By systematically examining each of the above aspects, you should be able to find and resolve the root cause of the 404 error.
The above is the detailed content of How to fix 404 errors encountered when deploying a ThinkPHP 6 project on port 8088 via Nginx on Ubuntu?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Entering CSGO HD blockbuster mode requires four steps: 1. Update the game client to the latest version; 2. Adjust the video settings to the highest parameters; 3. Start the game and enter high-definition mode; 4. Optimize performance and test adjustments. Through these steps, you can improve the gaming experience of CSGO and enjoy a clearer picture and a more immersive gaming environment.

When configuring Nginx on Debian system, the following are some practical tips: The basic structure of the configuration file global settings: Define behavioral parameters that affect the entire Nginx service, such as the number of worker threads and the permissions of running users. Event handling part: Deciding how Nginx deals with network connections is a key configuration for improving performance. HTTP service part: contains a large number of settings related to HTTP service, and can embed multiple servers and location blocks. Core configuration options worker_connections: Define the maximum number of connections that each worker thread can handle, usually set to 1024. multi_accept: Activate the multi-connection reception mode and enhance the ability of concurrent processing. s

Linux system restricts user resources through the ulimit command to prevent excessive use of resources. 1.ulimit is a built-in shell command that can limit the number of file descriptors (-n), memory size (-v), thread count (-u), etc., which are divided into soft limit (current effective value) and hard limit (maximum upper limit). 2. Use the ulimit command directly for temporary modification, such as ulimit-n2048, but it is only valid for the current session. 3. For permanent effect, you need to modify /etc/security/limits.conf and PAM configuration files, and add sessionrequiredpam_limits.so. 4. The systemd service needs to set Lim in the unit file

How to safely download and install Ouyi OK APP? 1. Visit the official website: Use the Android browser to enter the official website and confirm it is the official website; 2. Find the download entrance: Click the "APP Download" button on the homepage; 3. Select the Android version: Select "Android Download" on the download page; 4. Download the APK file: Allow the browser to download APK installation packages from unknown sources; 5. Enable installation permissions: Go to the mobile phone settings to enable the "Unknown Source Application Installation" permission; 6. Complete the installation: Click the APK file to install, etc.

Two methods and precautions for downloading Binance on Android phones: 1. Download the APK file through the official website: visit Binance official website www.binance.com, click "Android APK Download", and enable the installation permission of the "Unknown Source" of your phone before completing the installation; 2. Download through a third-party application store: select a trusted store to search for "Binance", confirm the developer information and download and install it. Be sure to get the app from official channels, enable two-factor verification, regularly change passwords and be alert to phishing websites to ensure your account security.

As the world's leading cryptocurrency exchange, OKX provides a safe and reliable trading environment and a rich variety of digital assets. 1. Visit the official website www.okx.com to download the application; 2. Select the Android or iOS version according to the device; 3. Install the application and complete registration or login; 4. Enable two-factor verification to ensure account security. The platform supports spot trading, leveraged trading, contract trading, DeFi, OKX Earn financial management and NFT market.

Directly querying administrator passwords is not recommended in terms of security. The security design principle of Oracle database is to avoid storing passwords in plain text. Alternative methods include: 1. Reset the SYS or SYSTEM user password using SQL*Plus; 2. Verify the encrypted password through the DBMS_CRYPTO package.

To obtain the official correct address of the Ouyi Exchange APP, you need to go through the following three official channels: 1. Download the official website, visit the official domain name [adid]fe9fc289c3ff0af142b6d3bead98a923[/adid] and download the corresponding system version; 2. Follow the official social media account to obtain the latest download information; 3. Contact the official customer service to confirm. At the same time, users should be alert to phishing websites, check domain names, install antivirus software, enable secondary verification and avoid leakage of personal information to ensure account security.
