two versions of PHP on the same Ubuntu 18.04 server with Apache

Gianvel Velandia

I have a server with Ubuntu 18.04 on which I host two applications, one works with PHP 7.0 and the other with PHP 8.0. I have followed several guides where they explain in detail what to do with PHP-FPM and I do all the steps correctly without throwing errors but when checking in the browser it shows me version 8.0 for both. Could you help me with this?” Is there anything else you would like to know?

these are the virtual hosts

<VirtualHost *80:>
    ServerName certificacion.local
    DocumentRoot /var/www/certificacion.local

    <Directory /var/www/certificacion.local>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/run/php/php7.0-fpm.sock|fcgi://localhost/var/www/certificacion.local"

    ErrorLog ${APACHE_LOG_DIR}/certificacion.local-error.log
    CustomLog ${APACHE_LOG_DIR}/certificacion.local-access.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerName fiscalizacion.local
    DocumentRoot /var/www/fiscalizacion.local

    <Directory /var/www/fiscalizacion.local>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/run/php/php8.0-fpm.sock|fcgi://localhost/var/www/fiscalizacion.local"

    ErrorLog ${APACHE_LOG_DIR}/fiscalizacion.local-error.log
    CustomLog ${APACHE_LOG_DIR}/fiscalizacion.local-access.log combined
</VirtualHost>`

i tried to configure PHP-FPM

Любомир Горбей

That's how it works for me

<VirtualHost *:80>
    DocumentRoot "/var/www/qa-laravel/public"
        ServerName .....local
        <Directory "/var/www/qa-laravel/public">
                AllowOverride All
                Options Indexes FollowSymLinks
                Order allow,deny
                Allow from all
        </Directory>
             <FilesMatch \.php$>
                    SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhos>
            </FilesMatch>
    
    </VirtualHost>

Check PHP-FPM service: Confirm that the PHP-FPM services for both PHP versions are running properly.

 service php7.0-fpm status
 service php8.0-fpm status

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Running 2 versions of PHP on the same apache server

Running two PHP versions on the same server

Two Ubuntu versions on the same computer

Problems running two versions of ThinkingSphinx on the same server

Ubuntu 18 Point two domains to same folder

Using two different php versions on the same machine

installing two versions of php with xampp on ubuntu system

Conflicting PHP versions between Plesk's Apache and the server's Apache

PHP is not working on Ubuntu Apache server

How to run two versions of ElasticSearch with custom heap size on same server?

Since this morning the network is unreachable Ubuntu 18:04

Installing apt-cacher server for two ubuntu versions

Error installing two PHP Versions Ubuntu 12.04 with Plesk 11.5

React / Laravel (php) SPA on same (Apache) server

Ubuntu Server Installing PHP 7 WITHOUT Apache

Running two versions of java on the same linux server via same user for different application

Building two versions of the same application

Multiple versions of .NET on the same server

Do Apache ActiveMQ client and server have to use the same jar file versions?

How to route two different paths to the same server using apache

ubuntu-minimal 18:04 how to login via ssh?

Error installing ubuntu server 14:04 / 15:04

Ubuntu 20.10 (Pop OS) with Apache and multiple versions of PHP-FPM FilesMatch directive not working

Allow Glassfish and PHP to work together in the same server using Apache

Apache and GitLab on same server

Serving two websites with the same Nginx on the same ubuntu server redirect to same website

How to check the presence of php and apache on ubuntu server through ssh

Page Not Found on home network server (Ubuntu, PHP Apache, MySQL)

Installing Apache MPM Worker with PHP support on Ubuntu Server 14.04.1

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive