PHP Website
PHP websites are used to run PHP programs, such as WordPress, Laravel, ThinkPHP, etc.
Prerequisites
Before creating a PHP website, you need to install:
- Web Server: Nginx, OpenResty, or Apache
- PHP Runtime Environment: Install the required PHP version in Applications > Runtime Environments
Create PHP Website
- Go to the Website page
- Click the PHP tab
- Click Create Website
Configuration Items
- Name: Website identifier, e.g.,
wordpress - Domain: Bound domain, e.g.,
blog.example.com - Port: Listening port, default 80
- PHP Version: Select an installed PHP version
- Website Directory: Path where website files are stored
- Remarks: Optional remarks
Edit PHP Website
Click the Edit button in the website list to enter the edit page.
Domain and Listen
Configure the website's domain and listening port.

Basic Settings
Configure basic information such as website directory and PHP version.

- Website Directory: Absolute path where website files are stored
- Run Directory: Frameworks like Laravel need to set the run directory
- Default Document: Default homepage file, e.g.,
index.php,index.html - PHP Version: Select an installed PHP version
- Anti-Cross-Site Attack: When enabled, restricts PHP to only access files within the website directory
Rewrite Configuration
Rewrite is used for URL rewriting, supporting preset rules for common PHP programs.

Click the preset dropdown to select rewrite rules for common programs:

Supported presets include: WordPress, Laravel, ThinkPHP, Discuz, Drupal, ECShop, and other common PHP programs.
Website Directory Structure
After creating a website, the default directory structure:
/opt/ace/sites/website-name/public
├── index.php # Entry file
├── .user.ini # PHP configuration
└── ...PHP Version Switching
You can switch PHP versions in the Basic Settings of the website edit page:
- Enter the website edit page
- Click the Basic Settings tab
- Select a new version in the PHP Version dropdown
- Click Save
Note
Switching PHP versions may cause program incompatibility. Please verify in a test environment first.
PHP Configuration
php.ini Configuration
You can modify php.ini configuration in the Applications > Native Applications > PHP management page.
Common configuration items:
upload_max_filesize = 50M # Maximum upload file size
post_max_size = 50M # Maximum POST data size
max_execution_time = 300 # Maximum execution time
memory_limit = 256M # Memory limitDisabled Functions
PHP disables some dangerous functions by default, such as exec, system, passthru, etc. To enable them, modify the disable_functions configuration in php.ini.
Warning
Enabling dangerous functions may pose security risks. Please proceed with caution.
FAQ
502 Bad Gateway
- Check if PHP-FPM is running normally
- Check if the PHP version is correctly configured
File Upload Failed
- Check
upload_max_filesizeandpost_max_sizeconfiguration - Check directory permissions
Blank Page
- Enable PHP error display
- Check PHP error logs
