0

I've recently added a new project named panel in the Apache config file. Here is the VirtualHost:

<VirtualHost *:80>
        ServerName panel.lamtakam.com
        ServerAlias panel.lamtakam.com

        ServerAdmin myemail@gmail.com
        DocumentRoot /var/www/panel/public

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

Notes:

  1. I use Apache webserver
  2. I don't have fpm (for PHP)
  3. I have two PHP version installed on the server 7.2 and 7.4 and both are enabled.

When I run the project above throw the browser, I get the following error:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.0".

Which means it's getting executed using php7.2. Now I need to force Apache to execute it using php7.4. Any idea how can I do that?

Martin AJ
  • 6,261
  • 8
  • 53
  • 111
  • and you need to setup fpm. – OMi Shah Aug 15 '23 at 12:29
  • Why do you need to change the php version for that? Specify in your composer.json the PHP version and even better, don't run composer install at all on the webserver, there should not be such a requirement. – hakre Aug 15 '23 at 12:29
  • @hakre I've `"require": { "php": "^7.4",` inside the *composer.json* file, but apparently it still uses `php 7.2`. Since still getting error *"Composer dependencies require a PHP version ">= 7.4.0"."*. Also, what do you mean don't run `composer install`, well, I need to install packages, otherwise, how to install packages? – Martin AJ Aug 15 '23 at 12:35
  • Which OS are you using? – RiggsFolly Aug 15 '23 at 12:38
  • @RiggsFolly Ubuntu 1804 – Martin AJ Aug 15 '23 at 12:38
  • you build your software, e.g. locally or on a build server and then you deploy your package to the webserver. and next to require there is platform, see the link in the close message. – hakre Aug 15 '23 at 12:38
  • Remember `composer` is a terminal command. It does not use apache it uses the PHP CLI, and you can decide which PHP CLI you use on the command line – RiggsFolly Aug 15 '23 at 12:43
  • Check for how to https://stackoverflow.com/questions/43040685 – RiggsFolly Aug 15 '23 at 12:48
  • @RiggsFolly Thanks for the link you provided, but the problem I'm currently encountered, is getthig this: https://panel.lamtakam.com/ – Martin AJ Aug 15 '23 at 12:51
  • On the Lamtakam server, there are PHP `7.2` and `7.4` installed. What to do to make it executing using `7.4`? – Martin AJ Aug 15 '23 at 12:52
  • Yea, I think that is saying you are not running PHP7.4 but your requirements in composer say you need to be running PHP7,4 – RiggsFolly Aug 15 '23 at 12:52

0 Answers0