Setup and run php 8. 5 on oracle linux vps
Learn how to setup and run php 8. 5 on oracle linux vps (with https + reverse proxy)!

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() and array_last() — Return the first and last value of an array (or null if 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:

Launch 100% ssd oracle linux vps from $2. 49/mo!

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:

  1. Update System Packages

    Always start fresh:

    sudo dnf clean all sudo dnf update -y

    If the kernel updates:

    sudo reboot
  2. 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
  3. 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
  4. 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
  5. Enable & Start PHP-FPM

    sudo systemctl enable --now php-fpm systemctl status php-fpm
  6. Install and Enable Nginx (Recommended)

    sudo dnf install -y nginx sudo systemctl enable --now nginx
  7. 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
  8. Configure Nginx Reverse Proxy for PHP-FPM

    Replace example.com with 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
  9. 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
    
  10. 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
  11. 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
  12. Optional Extensions

    sudo dnf install -y php-redis php-pecl-imagick php-bcmath php-pgsql php-sodium
  13. Firewall Rules (If Using Firewalld)

    sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo firewall-cmd --reload
  14. 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.
Launch 100% ssd oracle linux vps from $2. 49/mo!

Conclusion

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

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.
lg