i am unable to install this library from GitHub. [Minishlink/web-push]
I have Laravel 5 installed on my server, I want to install this in the Laravel directory (project). And will use the library via custom PHP.
I am facing below issues:
When I run composer require minishlink/web-push, I get below error:
When I run composer require mdanter/eec, I get below error
When I run composer require pargonie/rndom_compat, I get below error
Here is the composer.json file (I have not included the web-push file here as I am using the require command via putty, [Please correct me if I'm wrong])
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"guzzlehttp/guzzle": "~4.0",
"maatwebsite/excel": "~2.0.0",
"aloha/twilio": "^2.0",
"laravel/socialite": "2.0.*",
"ixudra/curl": "6.*",
"laracasts/utilities": "^2.1"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"laracasts/utilities": "~2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
This is the same type of issue as #17. It's not related to Minishlink/web-push. One of your dependancies is stuck in the past with paragonie/random_compat v1.1.5. You should check which one and ask the owner to update the composer.json. To fix this temporarily, in your composer.json, on your dev machine put:
"paragonie/random_compat": "dev-master as 1.1.5",
"minishlink/web-push": "^1.1"
Related
Is it safe to create a composer lock file in Windows, use that lock file in a server that runs on Linux (Centos 6.8 to be exact) and expect the same installed packages/functionality as long as PHP versions match between the 2? My current dev environment actually relies on Docker with containers that mimic our production server but I run into an issue if I use Composer on it. While it works fine, trying to get Laravel Dusk (an automated browser testing framework by the Laravel developers) to work headless in an acceptable manner on my Centos setup is a frustrating task. But that's a problem better fit as a separate question.
In comparison, it works fine on my host/Windows but I would have to run Composer there instead to generate the necessary bin .bat files since Dusk needs to make calls to /path/to/composer/bin/phpunit.bat on a Windows environment.
The following is how my composer file looks like (basically close to stock with some extra libraries)
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"guzzlehttp/guzzle": "~6.0",
"laravelcollective/html": "^5.3",
"imagine/imagine": "~0.5.0",
"predis/predis": "~1.0",
"dompdf/dompdf": "^0.7.0",
"laravel/dusk": "^1.0",
"laravel/browser-kit-testing": "^1.0",
"santigarcor/laratrust": "3.0.*",
"laravel/passport": "^2.0",
"dingo/api": "1.0.*#dev"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"barryvdh/laravel-ide-helper": "^2.2",
"deployer/deployer": "^4.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Tests\\": "tests/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php",
"tests/BrowserKitTest.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
I use unisharp file manager in my project. on my local machine everything works fine, but on remote server it throws error [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider' not found
in config/app.php everything's correct
/*FileMananger*/
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
/*CKEditor*/
Unisharp\Ckeditor\ServiceProvider::class,
there is directory unisharp in vedor(so all files and directories are there). when i try to run composer install/update i get this error again. so everything in its right place, but laravel doesn't see this class.
comoser.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"maatwebsite/excel": "~2.1.0",
"appzcoder/crud-generator": "^1.2",
"laravelcollective/html": "^5.3",
"lavary/laravel-menu": "dev-master",
"nesbot/carbon": "^1.21",
"laracasts/flash": "^2.0",
"spatie/laravel-medialibrary": "^3.11",
"firebase/php-jwt": "^4.0",
"doctrine/dbal": "^2.5"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Http/helpers.php"
]
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Try to comment those lines in config/app.php and run composer require unisharp/laravel-filemanager again.
You can't set up service providers before they are downloaded through composer.
You need to run:
composer require unisharp/laravel-filemanager
Make sure your config/app.php unisharp providers is matched with the content in folder vendor unisharp composer.json
check below:
Config/app.php
vendor/unisharp-composer.json
the solution is very easy :)
just make sure you have this in your service provider:
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
not this one:
UniSharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
Everytime I run the command composer install --no-dev
I am getting this error, I am using maatwebsite in laravel as the error pointing out, I just don't know how to fix it.
PHP Fatal error: Uncaught
Symfony\Component\Debug\Exception\FatalThrowableError
: Class 'PHPExcel_Shared_Font' not found in
/var/www/laravel/config/excel.php:18
2 Stack trace:
0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap
/LoadConfiguration.php(60): require()
1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap
/LoadConfiguration.php(38):
Illuminate\Foundation\Bootstrap\LoadConfiguration->l
oadConfigurationFiles(Object(Illuminate\Foundation\Application),
Object(Illumina
te\Config\Repository))
2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Applicati
on.php(203):
Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(Object
(Illuminate\Foundation\Application))
3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/K
ernel.php(268):
Illuminate\Foundation\Application->bootstrapWith(Array)
4 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/K
ernel.php(114): Illuminate\Foundation\Console\Kernel->boo in
/var/www/laravel/co
nfig/excel.php on line 182 Script php artisan optimize handling the
post-install-cmd event returned with er
ror code 255
Update:
This is the composer.json file content
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*",
"maatwebsite/excel": "~2.1.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
I would assume the reason you getting this error is because you're running --no-dev and you have maatwebsite/excel listed as a require-dev dependency.
You'll need to remove it as a dev dependency and then require it as a normal dependency and it should be fine.
Hope this helps!
i managed to re make my composer.json file
I was working on a project, by mistake, the main composer file was deleted.
cannot recover it manually, I still have vendor folders and files now I cannot add anything else because it will delete the current vendors is there any way to regenerate the composer file with vendors included in it?
now im getting
Whoops, looks like something went wrong.
1/1
FatalErrorException in Controller.php line 27:
Call to undefined function App\Http\Controllers\getcong()
{
"name": "testing/test",
"description": "test",
"keywords": ["test"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"SocialiteProviders/Manager": "^2.1",
"Simexis/Installer": "^1.6",
"Laravel/Socialite": "^2.0",
"Intervention/Image": "^2.3",
"Illuminate/Html": "^5.0",
"laravel/socialite": "^2.0",
"terbium/db-config": "^2.0",
"laravelcollective/html": "5.*",
"yajra/laravel-datatables-oracle": "^6.21",
"socialiteproviders/vkontakte": "^2.0"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"barryvdh/laravel-translation-manager": "0.2.x",
"psy/psysh": "^0.7.2"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"php artisan serve"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
i believe this is causing the error:
"terbium/db-config": "^2.0",
usage example: getcong('p-news')
thank you.
I need to add
"files": [
"app/Http/helpers.php"
]
to composer file :)
I am trying to run command
composer update
getting this error message:
[RuntimeException]
Could not scan for classes inside "database" which does not appear to
be a file nor a folder
This is the code inside my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"jenssegers/mongodb": "^2.0",
"lucadegasperi/oauth2-server-laravel": "^5.1",
"laravelcollective/html": "5.2.*",
"davibennun/laravel-push-notification": "dev-laravel5"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
We can resolve this issue by create database folder under our project root: <PROJECT_ROOT>/database. If we want to make sure all things are good to use, we can delete composer.lock file and run the composer update command again.