Why isn't PHP-FPM working?

General Tech Bugs & Fixes 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I have a Linux Mint 19 setup that's running Apache2 and two version of PHP-FPM:

  • 7.1
  • 7.2

I got my 7.1 site up and running but now I'm trying to get my other site to run on php7.2 but it's not working and I'm not sure how to resolve. It's loading PHP7.1 despite the configuration I've added.

Site .htaccess file looks like this:

AddHandler php72-fcgi .php

And my vhost:


    ServerName proj2.local
    DocumentRoot /var/www/proj2

    
        # This is to forward all PHP to php-fpm.
        
            SetHandler "proxy:fcgi://127.0.0.1:9500"
            SetHandler application/x-httpd-php
        

        Options Indexes FollowSymLinks
        AllowOverride All
    

And my www.conf has only one change in it (from default):

listen = 127.0.0.1:9500

I ran after the changes:

$ sudo service apache2 restart
$ sudo service php7.2-fpm restart

I created a info.php in proj2 directory and it displays information for PHP7.1. Why is it pointing to PHP7.1 and not PHP7.2?

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.