Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

sebgates's avatar

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". on c panel server

Hi, I am a web design teacher at a college and used Laravel 8 last year to get students to create a blog. I want to keep using Laravel next year but get students to host the website. Some students got this message when running their app, but we fixed it by using composer install --ignore-platform-req=php. I understand Laravel should probably not be hosted on shared hosting like C Panel, but I need to use free hosting for students due to financial constraints. Heroku is too complicated for my students as they are on a Media/Technology degree. I am trying to get Laravel running on Infinity Free hosting (C Panel) but the highest PHP version is 7.4 (which should run Laravel 8). Does anyone know how I can force Laravel 8 to use PHP 7.4 on a shared C Panel server?

0 likes
9 replies
Sinnbeck's avatar

First install it locally on 7.4. That should ensure that the composer.lock file is set to allow 7.4 on the server as well.

1 like
sebgates's avatar

@Sinnbeck - How to I install locally on 7.4? I am using composer and I think it must pick the highest version of PHP when creating a project? But again, that is a guess as I an new to Laravel.

Sinnbeck's avatar

@sebgates You can install the php version you want. How have you installed php locally?

sebgates's avatar

@Sinnbeck - yep sebgates@Sebastians-MBP ~ % php -v PHP 8.0.13 (cli) (built: Nov 19 2021 08:51:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.13, Copyright (c) Zend Technologies with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies sebgates@Sebastians-MBP ~ %

sebgates's avatar

@Sinnbeck - I am using a mac for local development and have homebrew installed. I found an article on StackOverflow about installing older versions of PHP on a mac. I will give it a go. Thanks

muathye's avatar

This setting to override default php version and it is generated from a cPanel you can modify it if you are aware about php versions in you cPanel.

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

Please or to participate in this conversation.