I've been trying to install laravel on Ubuntu 14.04. I finished all the steps, but when try to
laravel new mySite
the following message is deployed:
Crafting application...
sh: 1: composer: not found
Application ready! Build something amazing.
It's looks like some trouble with composer, but I don't know why. Composer seems to work, so, what is wrong? Thank you!
I got the same error.
I fixed it with simple symlink.
locate it. Run: # whereis composer
composer: /usr/local/bin/composer.phar
then create link: # sudo ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
Thats it. All works.
If you run composer on shell, does it run? otherwise run:
sudo apt-get install curl php5-cli git
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Then try again, maybe you could try the composer installation syntax:
composer create-project --prefer-dist laravel/laravel blog
To be sure composer is updated to the latest version and nothing is in cache run:
composer self-update
composer clear-cache
I still can't use laravel new, but I found what was happening with composer.
Laravel 5.3 needs php5.6 or higher, otherwise will run an older laravel version. I upgrade to php5.6 with this steps: https://www.dev-metal.com/install-setup-php-5-6-ubuntu-14-04-lts/
then run
composer create-project laravel/laravel ProjectName
and it's done!
Related
New to Laravel and I am having trouble getting bootstrap going with my project. I am not sure what I'm doing wrong.
I will give steps to see if anyone can repro and advise. Thanks in advance
I started with a fresh install of Ubuntu 22.04
1. Install PHP 8.1.2:
sudo apt install -y php php-common php-cli php-gd php-mysqlnd php-curl php-intl php-mbstring php-bcmath php-xml php-zip
2. Install Composer:
sudo apt install -y curl
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/bin --filename=composer
3. Create Laravel Project:
composer create-project laravel/laravel --prefer-dist laravel-bootstrap
cd laravel-bootstrap
4. Install Laravel/UI & Bootstrap
composer require laravel/ui
php artisan ui bootstrap
php artisan ui bootstrap --auth
npm install
npm run dev
When I run npm run dev, I get this message :
dev
vite
file:///var/www/laravel-bootstrap/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^
SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
If I run php artisan serve and go to http://127.0.0.1:8000 I get the default Laravel page and it looks fine, but if I go to http://127.0.0.1:8000/login, I get a Missing Vite Manifest File error message
screenshot of error : https://i.postimg.cc/Njzn2wBp/Screenshot-from-2022-08-18-00-11-28.png
I had pretty same problem and found solution for me
here
Update npm and node versions first and install Breeze if you don't have it already.
Briefly what I've done after:
npm install --save-dev vite laravel-vite-plugin
npm install --save-dev #vitejs/plugin-vue
Then updated package.json:
"scripts": {
"build": "vite build"
}
And
npm run build
Hope it will help ;)
I am installing the Laravel framework in directory /var/html/www, using command
php composer.phar global require "laravel/installer"
It changes installation directory automatically, shown message is:
Changed current directory to /home/.composer
What is the reason? Do I need to add any other command?
This is because you installed the Laravel installer with global, which makes it globally available for all projects and installs it to /home/.composer.
This should be all right because it is only Laravel's installer and not a Laravel project which should be created in a later step (see below) and this should be installed in your /var/html/www then.
Run the following command in your /var/html/www to create a new project (doesn't need Laravel installer):
composer create-project --prefer-dist laravel/laravel YourProjectName 5.2
or use the Laravel installer
laravel new YourProjectName
For more info how to install Laravel see the documentation here.
Let use
composer create-project --prefer-dist laravel/laravel project_name "5.2.*"
1) change the permission of your directory to allow CRUD.
Open Terminal and paste this command
sudo chmod -R o+rw /var/html/www
2) update the package manager cache by running:
sudo apt-get update
3) cd to your directory to check if composer json does exist
cd /var/html/www
and type
composer
4) To install composer in your directory run
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
5) To test if it's installed run
composer
6) Now install laravel 5.2 in your directory (/var/html/www)
composer create-project laravel/laravel ProjectName 5.2 --prefer-dist
Hey just started working on laravel. First day for me. Not much idea. Step by step following the steps from documentation given by https://www.laravel.com
After installing composer on my desktop at root folder. As soon, i opened composer.phar, it showed this error -> there is a problem opening the file "/root/composer.phar"
I followed steps given in https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx .
apt-get install curl
apt-get install php5-cli
curl-sS https://getcomposer.org/installer | php
php composer.phar
Is there any problem ? Please help me........
For installing composer try follow this
sudo apt-get install curl
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
Setting up Laravel
Run only composer and see if composer is installed.
If yes then let's install laravel installer to quickly install laravel. Run this command from your command line composer global require "laravel/installer=~1.1"
Now if you are using zsh then add this line to user home directories .zshrc file export PATH="~/.composer/vendor/bin:$PATH"
Else add this lines to .bashrc file export PATH="~/.composer/vendor/bin:$PATH"
Now you can run laravel new blog and a new laravel installation will be downloaded.
Now run php artisan serve from that directory to serve your laravel
See http://laravel.com/docs/5.1/#installation for more details
Tips: You can create a separate file and include it to your
.zshrc or .bashrc
I am new to Composer and trying to install a package via composer as
$ php composer require intervention/image
but i am getting
Could not open input file: composer
error since i have just run my last composer command 10 mins ago.
I don't now what is causing that problem.
Any help would be appreciated.
Try the following, then execute your command again.
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
Then you can use composer instead of php composer ...
Source
Most probably in your case Composer was installed globally, as a stanalone application.
Instead of
php composer require intervention/image
run
composer require intervention/image
I have installed phpunit in my ubuntu 11.10 having php version 5.2.14.
But when I run my test module it is throwing error,
PHP Fatal error: Call to undefined method PHP_CodeCoverage_Filter::getInstance() in /usr/share/php/PHPUnit/Autoload.php on line 64
I followed the steps mention in this stack question but still no luck.
Call to undefined method PHP_CodeCoverage_Filter::getInstance()
Following steps solved my problem.
sudo apt-get remove phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
sudo pear install --force --alldeps phpunit/PHPUnit
One workaround - granted, not really a solution - is to bypass PEAR install and use a local copy via Composer install.
Create a file in project root called composer.json:
{
"require": {
"phpunit/phpunit" : "3.7.*"
}
}
Of course, modify the phpunit version to "3.6.*" or similar, if you have such a requirement.
At project root:
# Install composer
$ curl -s https://getcomposer.org/installer | php
# Tell composer to install the dependencies identified in composer.json
$ php composer.phar install
# Now you can invoke the *local* copy of phpunit
$ ./vendor/phpunit/phpunit/composer/bin/phpunit --version
For simplicity, you can can create a symlink to the phpunit executable. Assuming you want the symlink in a directory called tests:
$ ln -s ./vendor/phpunit/phpunit/composer/bin/phpunit ./tests/phpunit
Then you can invoke as (from project root):
$ cd tests
$ ./phpunit --version
Even easier, you can direct Composer to handling the symlinking for you. Add this to your composer.json:
"config": {
"bin-dir": "tests"
}
Then, as before, you can invoke as (from project root):
$ cd tests
$ ./phpunit --version
Actually, what I usually do is have a project-level directory called scripts and point my composer bin-dir there. Then I manually create a symlink in tests pointing to scripts/phpunit. But this last step is probably more personal taste than any kind of requirement.
Maybe a long way to go just to beat PEAR issues, but I find Composer-based install works pretty reliably for me.
my platform Symfony 1.4 did not have installed the latest version of the plugin that is compatible with latest phpunit version. So updating to latest version of https://github.com/JWT-OSS/sfJwtPhpUnitPlugin/ worked for me.