
This articles provides a guide to setup and run PHP 8.5 on Oracle Linux VPS with secure web server and reverse proxy configured.
PHP 8.5 introduces powerful new language features including the Pipe Operator, URI extension, Clone-With syntax, new array helpers, safer attributes, and major performance improvements.
SEE ALSO: Top Use-Cases for Oracle Linux VPS Hosting
What’s New in PHP 8.5?
Here’s a breakdown of what’s new in PHP 8.5 (released November 20 2025):
✅ Key new features
- Pipe operator (
|>) — Enables chaining of values through functions left-to-right, improving readability$result = "Hello World" |> trim(...) |> (fn($s)=>str_replace(' ', '-', $s)) |> strtolower(...); - URI extension — Built-in extension for parsing/modifying URIs/URLs compliant with RFC 3986 & WHATWG standards (classes like
Uri\Rfc3986\Uri) clone($object, [...])(“Clone With”) — Ability to clone an object and update selected properties in one step, helping immutable/“with-er” patterns#[\NoDiscard]attribute — You can mark functions so that PHP warns if their return value is ignored, which encourages safer API usage- Closures & first-class callables in constant expressions — Static closures / first-class callables are now allowed in constant expressions (attributes, default param values, constants)
- New array helpers:
array_first()andarray_last()— Return the first and last value of an array (ornullif empty) - Fatal error backtraces — Fatal errors (e.g., max execution time exceeded) now include a full back-trace by default
- Various minor/quality-of-life improvements:
Prerequisites
Before you begin, you will need:
- Oracle Linux 8 or Oracle Linux 9 VPS
- SSH access with sudo/root privileges
- DNS A/AAAA records pointing to your VPS
- Nginx or Apache (Nginx recommended)
- Certbot required for automatic HTTPS
How to Setup and Run PHP 8.5 on Oracle Linux VPS (with HTTPS + Reverse Proxy)
To setup and run PHP 8.5 on Oracle Linux VPS, follow the steps below:
-
Update System Packages
Always start fresh:
sudo dnf clean all sudo dnf update -y
If the kernel updates:
sudo reboot
-
Install EPEL & Remi Repositories (Required for PHP 8.5)
Enable EPEL:
sudo dnf install -y oracle-epel-release-el$(rpm -E %rhel)
Enable Remi release:
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-$(rpm -E %rhel).rpm
-
Enable PHP 8.5 Stream
Reset default:
sudo dnf module reset php -y
Enable Remi’s PHP 8.5:
sudo dnf module enable php:remi-8.5 -y
-
Install PHP 8.5 + Common Extensions
sudo dnf install -y php php-cli php-fpm php-common php-opcache php-mysqlnd php-mbstring php-xml php-gd php-json php-intl php-zip php-curl php-pdo php-devel
Verify installation:
php -v
Output should include:
PHP 8.5.x
-
Enable & Start PHP-FPM
sudo systemctl enable --now php-fpm systemctl status php-fpm
-
Install and Enable Nginx (Recommended)
sudo dnf install -y nginx sudo systemctl enable --now nginx
-
Install Certbot (Required for HTTPS)
For Nginx:
sudo dnf install -y certbot python3-certbot-nginx
For Apache (optional):
sudo dnf install -y certbot python3-certbot-apache
-
Configure Nginx Reverse Proxy for PHP-FPM
Replace
example.comwith your domain:sudo nano /etc/nginx/conf.d/example.com.conf
Insert:
# Redirect all traffic to HTTPS server { listen 80; listen [::]:80; server_name example.com www.example.com; return 301 https://$host$request_uri; } # Main HTTPS virtual host server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com www.example.com; root /var/www/html; index index.php index.html; # SSL (filled automatically by Certbot) ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # PHP-FPM reverse proxy location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; } # Static cache location ~* \.(jpg|jpeg|png|gif|svg|ico|css|js|webp|map)$ { expires 7d; add_header Cache-Control "public, max-age=604800"; } # Security headers add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; }Test & reload:
sudo nginx -t sudo systemctl reload nginx
-
Obtain SSL Certificate with Certbot
Certbot automatically injects SSL configuration into your Nginx site.
sudo certbot --nginx
Choose:
- Your domain
- Redirect HTTP → HTTPS (yes)
Test renewal:
sudo certbot renew --dry-run
-
Reverse Proxy for Backend App (Optional: Node, Python, Go)
If you have a backend app running on localhost:3000:
sudo nano /etc/nginx/conf.d/app.example.com.conf
server { listen 80; server_name app.example.com; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name app.example.com; ssl_certificate /etc/letsencrypt/live/app.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/app.example.com/privkey.pem; location / { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_read_timeout 90; } }Reload:
sudo systemctl reload nginx
-
Optimize PHP 8.5 for Production
Edit the main configuration:
sudo nano /etc/php.ini
Recommended values:
memory_limit = 512M upload_max_filesize = 128M post_max_size = 128M max_execution_time = 120 ; Opcache opcache.enable=1 opcache.memory_consumption=256 opcache.max_accelerated_files=20000 opcache.validate_timestamps=0
Restart PHP-FPM:
sudo systemctl restart php-fpm
-
Optional Extensions
sudo dnf install -y php-redis php-pecl-imagick php-bcmath php-pgsql php-sodium
-
Firewall Rules (If Using Firewalld)
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload
-
Keep System Updated
sudo dnf update -y
Conclusion
You now have:
✓ PHP 8.5 installed from Remi
✓ PHP-FPM running
✓ Nginx configured
✓ Full reverse proxy support
✓ Automatic HTTPS via Certbot
✓ Optimized production configuration
Your Oracle Linux VPS is now fully ready to run PHP-based applications such as WordPress, Laravel, WHMCS, Symfony, APIs, and custom applications.

Conclusion
You now know how to setup and run PHP 8.5 on Oracle Linux VPS and setup HTTPS with a reverse proxy!








