6

When entering artisan commands in laravel- ubuntu 20.04 it shows following error

PHP Warning: Cannot load module "http" because required module "raphf" is not loaded in Unknown on line 0

PHP version 8.1.1, Laravel 8 , Ubuntu 20.04

screen shot

4
  • 7
    Try sudo apt install php-raphf.
    – Jos
    Jan 13, 2022 at 17:26
  • E: Unable to locate package php-raph
    – hemil
    Jan 14, 2022 at 4:24
  • It's in the universe repo.
    – Jos
    Jan 14, 2022 at 12:41
  • Does this answer your question? How do I enable the "Universe" repository?
    – karel
    Apr 12, 2022 at 11:18

2 Answers 2

10

Installing the package solved the issue for me:

$ sudo apt install php-raphf
2
  • php-raphf is already the newest version (2.0.1+1.1.2-13+ubuntu20.04.1+deb.sury.org+10). Aug 12, 2022 at 13:36
  • @ahmednawazbutt Try to install with specific your php version. For example, if you use php8.1, try sudo apt install php8.1-raphf. To check your php version, you can run command, php --version.
    – ibnɘꟻ
    Mar 18, 2023 at 4:21
3

Some more details. This occurs when you switch PHP versions - it happened to me when I switched to PHP 8.

If you check for your installed version of php-raphf with

apt list php-raphf

You will notice that you (most likely) have it. However, if you run

$ sudo apt install php-raphf

as described above, Ubuntu will install a PHP-dependent version:

The following NEW packages will be installed:
  php-raphf php8.1-raphf
1
  • 1
    Yes 👍 If you have multiple php versions installed, like when using php-fpm, you'll have to specify the version number. Usually you can check in '''/etc/php''' or '''/use/bin/''' wich php versions you have installed and you can switch with '''sudo update-alternatives'''' for php-cli and separately in your webserver config (nginx, Apache, etc)
    – Jakke
    Mar 19, 2023 at 12:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .