I’m encountering an issue while trying to install and use Laravel and Composer on my Kali Linux system. Here are the steps I’ve taken:
-
I installed Composer globally using the following command:
composer global require laravel/installer
-
added the path to Composer’s global bin directory to my .zshrc file as follows:
export PATH="$PATH:$HOME/.composer/vendor/bin
-
I ran source
~/.zshrc
to apply the changes to my current shell session.
However, when I try to run the laravel command, I get the following error: "laravel: command not found."
I’ve checked my $PATH variable, and it includes the correct path to Composer’s global bin directory. Additionally, I have confirmed that Composer and Laravel are correctly installed.
Can anyone help me understand why I’m still encountering this issue and how I can resolve it?
When tend to install this way: composer create-project laravel/laravel voteHub, I still encounter this error:
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/laravel-ignition[2.0.0, ..., 2.3.0] require ext-curl * -> it is missing from your system. Install or enable PHP's curl extension.
- Root composer.json requires spatie/laravel-ignition ^2.0 -> satisfiable by spatie/laravel-ignition[2.0.0, ..., 2.3.0].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/8.2/cli/php.ini
- /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
- /etc/php/8.2/cli/conf.d/10-opcache.ini
- /etc/php/8.2/cli/conf.d/10-pdo.ini
- /etc/php/8.2/cli/conf.d/15-xml.ini
- /etc/php/8.2/cli/conf.d/20-calendar.ini
- /etc/php/8.2/cli/conf.d/20-ctype.ini
- /etc/php/8.2/cli/conf.d/20-dom.ini
- /etc/php/8.2/cli/conf.d/20-exif.ini
- /etc/php/8.2/cli/conf.d/20-ffi.ini
- /etc/php/8.2/cli/conf.d/20-fileinfo.ini
- /etc/php/8.2/cli/conf.d/20-ftp.ini
- /etc/php/8.2/cli/conf.d/20-gettext.ini
- /etc/php/8.2/cli/conf.d/20-iconv.ini
- /etc/php/8.2/cli/conf.d/20-intl.ini
- /etc/php/8.2/cli/conf.d/20-mbstring.ini
- /etc/php/8.2/cli/conf.d/20-mysqli.ini
- /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
- /etc/php/8.2/cli/conf.d/20-phar.ini
- /etc/php/8.2/cli/conf.d/20-posix.ini
- /etc/php/8.2/cli/conf.d/20-readline.ini
- /etc/php/8.2/cli/conf.d/20-shmop.ini
- /etc/php/8.2/cli/conf.d/20-simplexml.ini
- /etc/php/8.2/cli/conf.d/20-sockets.ini
- /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/8.2/cli/conf.d/20-sysvsem.ini
- /etc/php/8.2/cli/conf.d/20-sysvshm.ini
- /etc/php/8.2/cli/conf.d/20-tokenizer.ini
- /etc/php/8.2/cli/conf.d/20-xmlreader.ini
- /etc/php/8.2/cli/conf.d/20-xmlwriter.ini
- /etc/php/8.2/cli/conf.d/20-xsl.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-curl` to temporarily ignore these required extensions.
2
Answers
simply use the following command
composer create-project laravel/laravel example-app
to create a laravel project. now if you want to install or run laravel on linux you can use Docker see docyou need to install the curl extension by running the following command
sudo apt install php-curl