Deploy Heroku/Laravel - Forbidden - Sem Permissão - laravel

I’m with a problem in deploy to heroku, using a application laravel. Initially only I created a application laravel default and add:
Procfile
web: vendor/bin/heroku-php-apache2 public/
composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-install-cmd": [
"php artisan clear-compiled",
"chmod -R 775 public/"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
Something which I verified too, in half of search in Internet went which Procfile need to be with the "P" uppercase. But inserting the Procfile that pattern in deploy alright generate the error:
log Heroku:
-----> Building on the Heroku-20 stack
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
- php (7.4.14)
- ext-mbstring (bundled with php)
- apache (2.4.46)
- nginx (1.18.0)
- composer (2.0.8)
-----> Installing dependencies...
Composer version 2.0.8 2020-12-03 17:20:38
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 62 installs, 0 updates, 0 removals
- Installing doctrine/inflector (2.0.3): Extracting archive
- Installing doctrine/lexer (1.2.1): Extracting archive
- Installing dragonmantank/cron-expression (v2.3.1): Extracting archive
- Installing voku/portable-ascii (1.5.6): Extracting archive
- Installing symfony/polyfill-ctype (v1.22.0): Extracting archive
- Installing phpoption/phpoption (1.7.5): Extracting archive
- Installing vlucas/phpdotenv (v4.2.0): Extracting archive
- Installing symfony/css-selector (v5.2.1): Extracting archive
- Installing tijsverkoyen/css-to-inline-styles (2.2.3): Extracting archive
- Installing symfony/polyfill-php80 (v1.22.0): Extracting archive
- Installing symfony/polyfill-mbstring (v1.22.0): Extracting archive
- Installing symfony/var-dumper (v5.2.1): Extracting archive
- Installing symfony/deprecation-contracts (v2.2.0): Extracting archive
- Installing symfony/routing (v5.2.1): Extracting archive
- Installing symfony/process (v5.2.1): Extracting archive
- Installing symfony/polyfill-php73 (v1.22.0): Extracting archive
- Installing symfony/polyfill-php72 (v1.22.0): Extracting archive
- Installing symfony/polyfill-intl-normalizer (v1.22.0): Extracting archive
- Installing symfony/polyfill-intl-idn (v1.22.0): Extracting archive
- Installing symfony/mime (v5.2.1): Extracting archive
- Installing symfony/http-foundation (v5.2.1): Extracting archive
- Installing symfony/http-client-contracts (v2.3.1): Extracting archive
- Installing psr/event-dispatcher (1.0.0): Extracting archive
- Installing symfony/event-dispatcher-contracts (v2.2.0): Extracting archive
- Installing symfony/event-dispatcher (v5.2.1): Extracting archive
- Installing psr/log (1.1.3): Extracting archive
- Installing symfony/error-handler (v5.2.1): Extracting archive
- Installing symfony/http-kernel (v5.2.1): Extracting archive
- Installing symfony/finder (v5.2.1): Extracting archive
- Installing symfony/polyfill-intl-grapheme (v1.22.0): Extracting archive
- Installing symfony/string (v5.2.1): Extracting archive
- Installing psr/container (1.0.0): Extracting archive
- Installing symfony/service-contracts (v2.2.0): Extracting archive
- Installing symfony/console (v5.2.1): Extracting archive
- Installing symfony/polyfill-iconv (v1.22.0): Extracting archive
- Installing egulias/email-validator (2.1.25): Extracting archive
- Installing swiftmailer/swiftmailer (v6.2.5): Extracting archive
- Installing ramsey/collection (1.1.3): Extracting archive
- Installing brick/math (0.9.2): Extracting archive
- Installing ramsey/uuid (4.1.1): Extracting archive
- Installing psr/simple-cache (1.0.1): Extracting archive
- Installing opis/closure (3.6.1): Extracting archive
- Installing symfony/translation-contracts (v2.3.0): Extracting archive
- Installing symfony/translation (v5.2.1): Extracting archive
- Installing nesbot/carbon (2.43.0): Extracting archive
- Installing monolog/monolog (2.2.0): Extracting archive
- Installing league/mime-type-detection (1.7.0): Extracting archive
- Installing league/flysystem (1.1.3): Extracting archive
- Installing league/commonmark (1.5.7): Extracting archive
- Installing laravel/framework (v7.30.4): Extracting archive
- Installing fideloper/proxy (4.4.1): Extracting archive
- Installing asm89/stack-cors (1.3.0): Extracting archive
- Installing fruitcake/laravel-cors (v1.0.6): Extracting archive
- Installing ralouphie/getallheaders (3.0.3): Extracting archive
- Installing psr/http-message (1.0.1): Extracting archive
- Installing guzzlehttp/psr7 (1.7.0): Extracting archive
- Installing guzzlehttp/promises (1.4.0): Extracting archive
- Installing guzzlehttp/guzzle (6.5.5): Extracting archive
- Installing nikic/php-parser (v4.10.4): Extracting archive
- Installing dnoegel/php-xdg-base-dir (v0.1.1): Extracting archive
- Installing psy/psysh (v0.10.6): Extracting archive
- Installing laravel/tinker (v2.6.0): Extracting archive
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Package manifest generated successfully.
44 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> php artisan clear-compiled
Compiled services and packages files removed!
> chmod -R 775 public/
-----> Preparing runtime environment...
-----> Checking for additional extensions to install...
-----> Discovering process types
! Push failed: cannot parse Procfile.
! Please try pushing again.
! If the problem persists, see https://help.heroku.com/ and provide Request ID 4c5a16cd-17da-959b-0f2c-20c06971f06b.
I tried too run in deploy with the Procfile with the "P" lowercase, and the run deploy without errors, but the screen continue without permission.
Will be missing more something configuration, I’m following the tutorial of self heroku and continue with the error

Related

heroku laravel - vite not found

Any help/guidance thank you in advance.
Today I've set up a Heroku dyno, but can't get the vite command to run.
Laravel 9.29, NodeJS 8.15
Trying to run heroku run npm run dev but returns /tmp/dev-3799b748.sh: 1: vite: not found
I've set the build packs to:
heroku buildpacks
=== manage-demo Buildpack URLs
heroku/nodejs
heroku/php
Also the Config Vars NPM_CONFIG_PRODUCTION = false, YARN_PRODUCTION = false
Commands used to create the Laravel Project:
composer create-project laravel/laravel <myprojectname>
composer require laravel/breeze
php artisan breeze:install react
php artisan migrate
npm install
Deploy Branch
-----> Building on the Heroku-22 stack
-----> Using buildpacks:
1. heroku/nodejs
2. heroku/php
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_PRODUCTION=false
NPM_CONFIG_LOGLEVEL=error
USE_NPM_INSTALL=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.17.0...
Using default npm version: 8.15.0
-----> Restoring cache
- node_modules (not cached - skipping)
-----> Installing dependencies
Installing node modules (package.json + package-lock)
added 165 packages, and audited 166 packages in 3s
25 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
Running build
> build
> vite build
vite v3.1.0 building for production...
transforming...
✓ 254 modules transformed.
rendering chunks...
public/build/manifest.json 3.78 KiB
public/build/assets/ConfirmPassword.6778c5aa.js 1.09 KiB / gzip: 0.61 KiB
public/build/assets/InputLabel.b7560c9a.js 0.20 KiB / gzip: 0.18 KiB
public/build/assets/TextInput.90051331.js 0.63 KiB / gzip: 0.39 KiB
public/build/assets/PrimaryButton.63fa2720.js 0.82 KiB / gzip: 0.49 KiB
public/build/assets/ApplicationLogo.4d214c56.js 3.06 KiB / gzip: 1.30 KiB
public/build/assets/ForgotPassword.863d1afc.js 1.06 KiB / gzip: 0.62 KiB
public/build/assets/Login.ffce380f.js 1.94 KiB / gzip: 0.89 KiB
public/build/assets/Register.13d4ee0d.js 1.95 KiB / gzip: 0.76 KiB
public/build/assets/ResetPassword.467e122e.js 1.57 KiB / gzip: 0.65 KiB
public/build/assets/VerifyEmail.800ac39d.js 1.07 KiB / gzip: 0.61 KiB
public/build/assets/Dashboard.c9f20060.js 17.64 KiB / gzip: 6.24 KiB
public/build/assets/Welcome.875c53e4.js 11.94 KiB / gzip: 3.72 KiB
public/build/assets/app.5c62c80a.css 22.06 KiB / gzip: 4.63 KiB
public/build/assets/app.36a55110.js 315.09 KiB / gzip: 107.01 KiB
-----> Caching build
- node_modules
-----> Pruning devDependencies
Skipping because NPM_CONFIG_PRODUCTION is 'false'
-----> Build succeeded!
-----> PHP app detected
-----> Bootstrapping...
-----> Preparing platform package installation...
-----> Installing platform packages...
- php (8.1.10)
- apache (2.4.54)
- composer (2.4.1)
- nginx (1.22.0)
NOTICE: detected userland polyfill packages for PHP extensions
NOTICE: now attempting to install native extension packages
Installing extensions provided by symfony/polyfill-mbstring:
- ext-mbstring...
Installing extensions provided by symfony/polyfill-ctype:
- ext-ctype...
-----> Installing dependencies...
Composer version 2.4.1 2022-08-20 11:44:50
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 70 installs, 0 updates, 0 removals
- Installing doctrine/inflector (2.0.5): Extracting archive
- Installing doctrine/lexer (1.2.3): Extracting archive
- Installing symfony/polyfill-ctype (v1.26.0): Extracting archive
- Installing webmozart/assert (1.11.0): Extracting archive
- Installing dragonmantank/cron-expression (v3.3.2): Extracting archive
- Installing symfony/polyfill-mbstring (v1.26.0): Extracting archive
- Installing symfony/deprecation-contracts (v3.1.1): Extracting archive
- Installing symfony/http-foundation (v6.1.4): Extracting archive
- Installing fruitcake/php-cors (v1.2.0): Extracting archive
- Installing psr/http-message (1.0.1): Extracting archive
- Installing psr/http-client (1.0.1): Extracting archive
- Installing ralouphie/getallheaders (3.0.3): Extracting archive
- Installing psr/http-factory (1.0.1): Extracting archive
- Installing guzzlehttp/psr7 (2.4.1): Extracting archive
- Installing guzzlehttp/promises (1.5.2): Extracting archive
- Installing guzzlehttp/guzzle (7.5.0): Extracting archive
- Installing voku/portable-ascii (2.0.1): Extracting archive
- Installing symfony/polyfill-php80 (v1.26.0): Extracting archive
- Installing phpoption/phpoption (1.9.0): Extracting archive
- Installing graham-campbell/result-type (v1.1.0): Extracting archive
- Installing vlucas/phpdotenv (v5.4.1): Extracting archive
- Installing symfony/css-selector (v6.1.3): Extracting archive
- Installing tijsverkoyen/css-to-inline-styles (2.2.4): Extracting archive
- Installing symfony/var-dumper (v6.1.3): Extracting archive
- Installing symfony/routing (v6.1.3): Extracting archive
- Installing symfony/process (v6.1.3): Extracting archive
- Installing symfony/polyfill-php72 (v1.26.0): Extracting archive
- Installing symfony/polyfill-intl-normalizer (v1.26.0): Extracting archive
- Installing symfony/polyfill-intl-idn (v1.26.0): Extracting archive
- Installing symfony/mime (v6.1.4): Extracting archive
- Installing psr/container (2.0.2): Extracting archive
- Installing symfony/service-contracts (v3.1.1): Extracting archive
- Installing psr/event-dispatcher (1.0.0): Extracting archive
- Installing symfony/event-dispatcher-contracts (v3.1.1): Extracting archive
- Installing symfony/event-dispatcher (v6.1.0): Extracting archive
- Installing psr/log (3.0.0): Extracting archive
- Installing egulias/email-validator (3.2.1): Extracting archive
- Installing symfony/mailer (v6.1.4): Extracting archive
- Installing symfony/error-handler (v6.1.3): Extracting archive
- Installing symfony/http-kernel (v6.1.4): Extracting archive
- Installing symfony/finder (v6.1.3): Extracting archive
- Installing symfony/polyfill-intl-grapheme (v1.26.0): Extracting archive
- Installing symfony/string (v6.1.4): Extracting archive
- Installing symfony/console (v6.1.4): Extracting archive
- Installing symfony/polyfill-php81 (v1.26.0): Extracting archive
- Installing ramsey/collection (1.2.2): Extracting archive
- Installing brick/math (0.10.2): Extracting archive
- Installing ramsey/uuid (4.4.0): Extracting archive
- Installing psr/simple-cache (3.0.0): Extracting archive
- Installing nunomaduro/termwind (v1.14.0): Extracting archive
- Installing symfony/translation-contracts (v3.1.1): Extracting archive
- Installing symfony/translation (v6.1.4): Extracting archive
- Installing nesbot/carbon (2.62.1): Extracting archive
- Installing monolog/monolog (2.8.0): Extracting archive
- Installing league/mime-type-detection (1.11.0): Extracting archive
- Installing league/flysystem (3.3.0): Extracting archive
- Installing nette/utils (v3.2.7): Extracting archive
- Installing nette/schema (v1.2.2): Extracting archive
- Installing dflydev/dot-access-data (v3.0.1): Extracting archive
- Installing league/config (v1.1.1): Extracting archive
- Installing league/commonmark (2.3.5): Extracting archive
- Installing laravel/serializable-closure (v1.2.2): Extracting archive
- Installing laravel/framework (v9.29.0): Extracting archive
- Installing inertiajs/inertia-laravel (v0.6.3): Extracting archive
- Installing laravel/breeze (v1.13.0): Extracting archive
- Installing laravel/sanctum (v2.15.1): Extracting archive
- Installing nikic/php-parser (v4.15.1): Extracting archive
- Installing psy/psysh (v0.11.8): Extracting archive
- Installing laravel/tinker (v2.7.2): Extracting archive
- Installing tightenco/ziggy (v1.4.6): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
INFO Discovering packages.
inertiajs/inertia-laravel ............................................. DONE
laravel/breeze ........................................................ DONE
laravel/sanctum ....................................................... DONE
laravel/tinker ........................................................ DONE
nesbot/carbon ......................................................... DONE
nunomaduro/termwind ................................................... DONE
tightenco/ziggy ....................................................... DONE
49 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
-----> Preparing runtime environment...
-----> Checking for additional extensions to install...
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 66M
-----> Launching...
Released v29
https://manage-demo.herokuapp.com/ deployed to Heroku
Starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis® will no longer be available.
If you have apps using any of these resources, you must upgrade to paid plans by this date to ensure your apps continue to run and to retain your data. For students, we will announce a new program by the end of September. Learn more at https://blog.heroku.com/next-chapter
heroku run npm run dev
npm WARN config production Use `--omit=dev` instead.
> dev
> vite
VITE v3.1.0 ready in 507 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
[..................] | : timing config:load:flatten Completed in 2ms
LARAVEL v9.29.0 plugin v0.6.0
➜ APP_URL: https://manage-demo.herokuapp.com/
node:internal/errors:477 timing config:load:flatten Completed in 2ms
ErrorCaptureStackTrace(err);
^
Error: ENOSPC: System limit for number of file watchers reached, watch '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h'
at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
at Object.watch (node:fs:2301:34)
at createFsWatchInstance (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49738:17)
at setFsWatchListener (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49785:15)
at NodeFsHandler$1._watchWithNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:49940:14)
at NodeFsHandler$1._handleFile (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50004:23)
at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50246:21)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:51434:10)
at NodeFsHandler$1._addToNodeFs (file:///app/node_modules/vite/dist/node/chunks/dep-665b0112.js:50254:18) {
errno: -28,
syscall: 'watch',
code: 'ENOSPC',
path: '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h',
filename: '/app/.heroku/node/include/node/openssl/archs/linux-x86_64/asm/include/progs.h'
}

Error when deploy Laravel 5.7 on Heroku for the first time

I have a fresh installation of Laravel 5.7 and when i try to deploy it in Heroku i get an error. I have also setup the APP-KEY value and the heroku/php Buildpak in Heroku settings.
Have any idea of whats happening?
Build log:
-----> PHP app detected
-----> Bootstrapping...
-----> Installing platform packages...
- php (7.3.1)
- ext-mbstring (bundled with php)
- apache (2.4.37)
- nginx (1.8.1)
-----> Installing dependencies...
Composer version 1.8.0 2018-12-03 10:31:16
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 53 installs, 0 updates, 0 removals
- Installing doctrine/inflector (v1.3.0): Downloading (100%)
- Installing doctrine/lexer (v1.0.1): Downloading (100%)
- Installing dragonmantank/cron-expression (v2.2.0): Downloading (100%)
- Installing erusev/parsedown (1.7.1): Downloading (100%)
- Installing vlucas/phpdotenv (v2.5.2): Downloading (100%)
- Installing symfony/css-selector (v4.2.2): Downloading (100%)
- Installing tijsverkoyen/css-to-inline-styles (2.2.1): Downloading (100%)
- Installing symfony/polyfill-php72 (v1.10.0): Downloading (100%)
- Installing symfony/polyfill-mbstring (v1.10.0): Downloading (100%)
- Installing symfony/var-dumper (v4.2.2): Downloading (100%)
- Installing symfony/routing (v4.2.2): Downloading (100%)
- Installing symfony/process (v4.2.2): Downloading (100%)
- Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%)
- Installing symfony/http-foundation (v4.2.2): Downloading (100%)
- Installing symfony/contracts (v1.0.2): Downloading (100%)
- Installing symfony/event-dispatcher (v4.2.2): Downloading (100%)
- Installing psr/log (1.1.0): Downloading (100%)
- Installing symfony/debug (v4.2.2): Downloading (100%)
- Installing symfony/http-kernel (v4.2.2): Downloading (100%)
- Installing symfony/finder (v4.2.2): Downloading (100%)
- Installing symfony/console (v4.2.2): Downloading (100%)
- Installing egulias/email-validator (2.1.7): Downloading (100%)
- Installing swiftmailer/swiftmailer (v6.1.3): Downloading (100%)
- Installing paragonie/random_compat (v9.99.99): Downloading (100%)
- Installing ramsey/uuid (3.8.0): Downloading (100%)
- Installing psr/simple-cache (1.0.1): Downloading (100%)
- Installing psr/container (1.0.0): Downloading (100%)
- Installing opis/closure (3.1.5): Downloading (100%)
- Installing symfony/translation (v4.2.2): Downloading (100%)
- Installing nesbot/carbon (1.36.2): Downloading (100%)
- Installing monolog/monolog (1.24.0): Downloading (100%)
- Installing league/flysystem (1.0.49): Downloading (100%)
- Installing ralouphie/getallheaders (2.0.5): Downloading (100%)
- Installing psr/http-message (1.0.1): Downloading (100%)
- Installing guzzlehttp/psr7 (1.5.2): Downloading (100%)
- Installing guzzlehttp/promises (v1.3.1): Downloading (100%)
- Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)
- Installing laravel/slack-notification-channel (v1.0.3): Downloading (100%)
- Installing zendframework/zend-diactoros (1.8.6): Downloading (100%)
- Installing php-http/promise (v1.0.0): Downloading (100%)
- Installing php-http/httplug (v1.1.0): Downloading (100%)
- Installing php-http/guzzle6-adapter (v1.1.1): Downloading (100%)
- Installing lcobucci/jwt (3.2.5): Downloading (100%)
- Installing nexmo/client (1.6.1): Downloading (100%)
- Installing laravel/nexmo-notification-channel (v1.0.1): Downloading (100%)
- Installing laravel/framework (v5.7.22): Downloading (100%)
- Installing fideloper/proxy (4.1.0): Downloading (100%)
- Installing jakub-onderka/php-console-color (v0.2): Downloading (100%)
- Installing nikic/php-parser (v4.2.0): Downloading (100%)
- Installing jakub-onderka/php-console-highlighter (v0.4): Downloading (100%)
- Installing dnoegel/php-xdg-base-dir (0.1): Downloading (100%)
- Installing psy/psysh (v0.9.9): Downloading (100%)
- Installing laravel/tinker (v1.0.8): Downloading (100%)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover --ansi
In PackageManifest.php line 168:
The /tmp/build_73d13e43929228fd562bd9df625e545c/bootstrap/cache directory m
ust be present and writable.
Script #php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
! WARNING: A post-autoload-dump script terminated with an error
! ERROR: Dependency installation failed!
!
! The 'composer install' process failed with an error. The cause
! may be the download or installation of packages, or a pre- or
! post-install hook (e.g. a 'post-install-cmd' item in 'scripts')
! in your 'composer.json'.
!
! Typical error cases are out-of-date or missing parts of code,
! timeouts when making external connections, or memory limits.
!
! Check the above error output closely to determine the cause of
! the problem, ensure the code you're pushing is functioning
! properly, and that all local changes are committed correctly.
!
! For more information on builds for PHP on Heroku, refer to
! https://devcenter.heroku.com/articles/php-support
!
! REMINDER: the following warnings were emitted during the build;
! check the details above, as they may be related to this error:
! - A post-autoload-dump script terminated with an error
! Push rejected, failed to compile PHP app.
! Push failed
Procfile:
web: vendor/bin/heroku-php-apache2 public/
composer.json, because a previous extra error, i add "laravel/dusk" to extra->laravel->dont-discover
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": [
"laravel/dusk"
]
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
A fresh Laravel install comes with a bootstrap/cache/.gitignore file. Its presence (and contents) in the respository ensures that the directory exists in a deployment, but that nothing else within that directory winds up in source control.
The error you're receiving indicates that you didn't check it into your repository (or removed it for some reason). Checking it in should clear up the message, as the folder will exist for your app to write to it.
There are several other instances of this, like storage/logs, a variety of subfolders of storage/framework, etc. If you receive similar errors in these directories, the same fix applies.

Laravel 5.6, Heroku and the Redis. Problems while deploying

Trouble:
Running the Laravel project on localhost without any problems, but attempt to deploy it on the Heroku is insuccessful.
Error:
FatalThrowableError
Class 'Predis\Client' not found
composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.3",
"darkaonline/l5-swagger": "5.6.*",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/passport": "^5.0",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1",
"spatie/laravel-permission": "^2.9"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "~1.1",
"phpunit/phpunit": "~7.0",
"reliese/laravel": "^0.0.13",
"symfony/thanks": "^1.0",
"xethron/migrations-generator": "^2.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Heroku CLI (logged to Heroku bash tty):
Here I tried to install composer dependencies and update them
~ $ composer install --dev && composer update
You are using the deprecated option "dev". Dev packages are installed by default now.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Package operations: 41 installs, 0 updates, 0 removals
- Installing symfony/thanks (v1.0.5): Downloading (100%)
- Installing doctrine/collections (v1.5.0): Downloading (100%)
- Installing doctrine/cache (v1.7.1): Downloading (100%)
- Installing doctrine/common (v2.8.1): Downloading (100%)
- Installing fzaninotto/faker (v1.7.1): Downloading (100%)
- Installing hamcrest/hamcrest-php (v2.0.0): Downloading (100%)
- Installing mockery/mockery (1.0): Downloading (100%)
- Installing filp/whoops (2.1.14): Downloading (100%)
- Installing nunomaduro/collision (v1.1.22): Downloading (100%)
- Installing webmozart/assert (1.3.0): Downloading (100%)
- Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
- Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
- Installing phpdocumentor/reflection-docblock (4.3.0): Downloading (100%)
- Installing phpunit/php-token-stream (3.0.0): Downloading (100%)
- Installing sebastian/version (2.0.1): Downloading (100%)
- Installing sebastian/resource-operations (1.0.0): Downloading (100%)
- Installing sebastian/recursion-context (3.0.0): Downloading (100%)
- Installing sebastian/object-reflector (1.1.1): Downloading (100%)
- Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
- Installing sebastian/global-state (2.0.0): Downloading (100%)
- Installing sebastian/exporter (3.1.0): Downloading (100%)
- Installing sebastian/environment (3.1.0): Downloading (100%)
- Installing sebastian/diff (3.0.0): Downloading (100%)
- Installing sebastian/comparator (2.1.3): Downloading (100%)
- Installing phpunit/php-text-template (1.2.1): Downloading (100%)
- Installing doctrine/instantiator (1.1.0): Downloading (100%)
- Installing phpunit/phpunit-mock-objects (6.0.1): Downloading (100%)
- Installing phpunit/php-timer (2.0.0): Downloading (100%)
- Installing phpunit/php-file-iterator (1.4.5): Downloading (100%)
- Installing theseer/tokenizer (1.1.0): Downloading (100%)
- Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
- Installing phpunit/php-code-coverage (6.0.1): Downloading (100%)
- Installing phpspec/prophecy (1.7.4): Downloading (100%)
- Installing phar-io/version (1.0.1): Downloading (100%)
- Installing phar-io/manifest (1.0.1): Downloading (100%)
- Installing myclabs/deep-copy (1.7.0): Downloading (100%)
- Installing phpunit/phpunit (7.0.1): Downloading (100%)
- Installing doctrine/dbal (v2.6.3): Downloading (100%)
- Installing reliese/laravel (v0.0.13): Downloading (100%)
- Installing xethron/laravel-4-generators (3.1.1): Downloading (100%)
- Installing xethron/migrations-generator (v2.0.2): Downloading (100%)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.0)
phpunit/phpunit suggests installing ext-xdebug (*)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: darkaonline/l5-swagger
Discovered Package: fideloper/proxy
Discovered Package: laravel/passport
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Discovered Package: spatie/laravel-permission
Discovered Package: xethron/migrations-generator
Package manifest generated successfully.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 5 updates, 0 removals
- Updating symfony/thanks (v1.0.5 => v1.0.6): Downloading (100%)
- Updating laravel/framework (v5.6.3 => v5.6.5): Downloading (100%)
- Updating darkaonline/l5-swagger (5.6.1 => 5.6.2): Downloading (100%)
- Updating phpseclib/phpseclib (2.0.9 => 2.0.10): Downloading (100%)
- Updating phpspec/prophecy (1.7.4 => 1.7.5): Downloading (100%)
- Installing predis/predis (v1.1.1): Downloading (100%)
predis/predis suggests installing ext-phpiredis (Allows faster serialization and deserialization of the Redis protocol) Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: darkaonline/l5-swagger
Discovered Package: fideloper/proxy
Discovered Package: laravel/passport
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Discovered Package: spatie/laravel-permission
Discovered Package: xethron/migrations-generator
Package manifest generated successfully.
What about running composer thanks now?
This will spread some 💖 by sending a ★ to the GitHub repositories of your fellow package maintainers.
~ $ ls vendor/|grep red
predis
As you see, redis folder is loaded successfully. But the Class 'Predis\Client' not found is still happening!
After closing the bash and relogin again to the Heroku the redis folder is mystically gone :'(
~ $ exit
C:\Users\XTreme.ws
λ heroku run bash -a dfs-server
Running bash on dfs-server... up, run.7714 (Free)
~ $ ls vendor/|grep red
~ $
In Heroku Dashboard the project is successfully deployed without any errors.
So what am I doing wrong? Googled over the Internet and have no any solution for that issue.
It was my fault: at one of the deployment steps I forgot to update my composer.lock with composer.json. Regenerating lock and pushing to my Heroku did the trick.

incomplete dependencies in laravel

When i created a project using composer
C:\xampp\htdocs>composer create-project laravel/laravel tipar 5.4.*
Installing laravel/laravel (v5.4.30)
- Installing laravel/laravel (v5.4.30): Loading from cache
Created project in tipar
php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 59 installs, 0 updates, 0 removals
- Installing symfony/css-selector (v3.3.9): Loading from cache
- Installing tijsverkoyen/css-to-inline-styles (2.2.0): Loading from cache
- Installing symfony/polyfill-mbstring (v1.5.0): Loading from cache
- Installing symfony/var-dumper (v3.3.9): Loading from cache
- Installing jakub-onderka/php-console-color (0.1): Loading from cache
- Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache
- Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache
- Installing nikic/php-parser (v3.1.1): Loading from cache
- Installing psr/log (1.0.2): Loading from cache
- Installing symfony/debug (v3.3.9): Downloading (100%)
- Installing symfony/console (v3.3.9): Downloading (100%)
- Installing psy/psysh (v0.8.11): Loading from cache
- Installing vlucas/phpdotenv (v2.4.0): Loading from cache
- Installing symfony/routing (v3.3.9): Loading from cache
- Installing symfony/process (v3.3.9): Loading from cache
- Installing symfony/http-foundation (v3.3.9): Downloading (100%)
this is the only output i get, there are some files that are missing.

Your requirements could not be resolved: failed to open stream: Permission denied

I Need to install DomPDf in my Project. So, i add "barryvdh/laravel-dompdf": "v0.7.0", to composer require block. when i update composer display following Errors. Whats my Mistakes.... Please Specify to me..
Terminal Errors
Your requirements could not be resolved to an installable set of packages.
Problem 1
- dompdf/dompdf v0.7.0-beta3 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta2 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta requires phenx/php-font-lib 0.3.* -> no matching package found.
- dompdf/dompdf v0.7.0 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf 0.7.x-dev requires phenx/php-font-lib 0.5.* -> no matching package found.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[0.7.x-dev, v0.7.0, v0.7.0-beta, v0.7.0-beta2, v0.7.0-beta3].
- Installation request for barryvdh/laravel-dompdf v0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
My Composer Code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"minimum-stability" : "dev",
"prefer-stable": true,
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-dompdf": "v0.7.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"uxweb/sweet-alert": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
}
I've also tried:
composer require barryvdh/laravel-dompdf
but it display following error:
Error : Using version ^0.8.0 for barryvdh/laravel-dompdf ./composer.json has been updated Loading composer repositories with package information
Updating dependencies (including require-dev)
file_put_contents(/home/w3cert/.composer/cache/repo/https---‌​packagist.org/p-prov‌​ider-2017-01.json): failed to open stream: Permission denied
packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Your requirements could not be resolved to an installable set of packages.
Since you've got the Permission denied error when running composer require barryvdh/laravel-dompdf, this is the command which should fix them:
chown -R $USER ~/.composer
or:
sudo chown -R $USER ~/.composer
Then clear the Composer caches:
composer clear
After than try to avoid running composer command with sudo to not break the file permissions.
If there is still any problem, in order to troubleshoot, run the following shell command:
composer diagnose
Why don't you try to install it from the command line
composer require barryvdh/laravel-dompdf
please delete this line from composer.json before installation.
"barryvdh/laravel-dompdf": "v0.7.0"
Anyway the current version of laravel-dompdf:(v0.8.0)
The installation should work with the current version of dompdf
"barryvdh/laravel-dompdf": "^0.8.0"

Resources