Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: laravel app #20

Closed
f3l1x opened this issue Aug 20, 2019 · 11 comments
Closed

Example: laravel app #20

f3l1x opened this issue Aug 20, 2019 · 11 comments

Comments

@f3l1x
Copy link
Collaborator

f3l1x commented Aug 20, 2019

No description provided.

@CraftLogan
Copy link

CraftLogan commented Aug 22, 2019

Hello, I am working on getting this up and running on laravel but when I run now dev I am stuck with this error PHP process errored Error: spawn php-cgi ENOENT
<img width="1088" ### alt="Screen Shot 2019-08-22 at 11 30 20 AM" src="https://user-images.githubusercontent.com/10950466/63528077-47e5e080-c4d0-11e9-80a0-f1e84c017ddf.png

@CraftLogan
Copy link

If anyone has any advice that would be great. Thanks Logan

@f3l1x
Copy link
Collaborator Author

f3l1x commented Aug 22, 2019

You need to install php locally on your computer. Also php-cgi binary.

@AGDholo
Copy link
Contributor

AGDholo commented Sep 15, 2019

Laravel default cache to '/storage' folder.This is different from the directory on the now.sh server.
I tried to rewrite StoragePath to '/tmp' but it failed.

@f3l1x
Copy link
Collaborator Author

f3l1x commented Sep 15, 2019

Hello @AGDholo. Only writable folder is /tmp, so you must rewrite all cache folders, session folder and other folders where laravel could write.

@AGDholo
Copy link
Contributor

AGDholo commented Sep 15, 2019

I solved the problem with the /tmp folder, just add the following code in bootstrap/app.php to override StoragePath.

# new storage path
# base_path() -> returns root path
$path_storage = "/tmp";

# override already $app->storagePath using the function
$app->useStoragePath($path_storage);

And set path in config/{cache.php, session.php, view.php}:
storage_path(xxxx) to storage_path()

But when I deploy it on the server, it throws an error: Uncaught ReflectionException: Class translator does not exist in.

The complete error is as follows:

127.0.0.1:37160 [500]: /var/task/user/public /index.php - Uncaught ReflectionException: Class translator does not exist in /var/task/user/vendor/laravel/framework/src/Illuminate/Container/Container.php:804
Stack trace:
#0 /var/task/user/vendor/laravel/framework/src/Illuminate/Container/Container.php(804): ReflectionClass->__construct('translator')
#1 /var/task/user/vendor/laravel/framework/src/Illuminate/Container/Container.php(682): Illuminate\Container\Container->build('translator')
#2 /var/task/user/vendor/laravel/framework/src/Illuminate/Container/Container.php(630): Illuminate\Container\Container->resolve('translator', Array)
#3 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(768): Illuminate\Container\Container->make('translator', Array)
#4 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(121): Illuminate\Foundation\Application->make('translator', Array)
#5 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(878): app('translator')
#6 /var/task/user/vendor/laravel/framewor in /var/task/user/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 806

Build warnning:


PHP Warning:  PHP Startup: Unable to load dynamic library 'gd' (tried: /tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/gd (/tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/gd: cannot open shared object file: No such file or directory), /tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/gd.so (libX11.so.6: cannot open shared object file: No such file or directory)) in Unknown on line 0
--
02:37:06 AM | PHP Warning:  PHP Startup: Unable to load dynamic library 'xsl' (tried: /tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/xsl (/tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/xsl: cannot open shared object file: No such file or directory), /tmp/1245e456561ac6e4/.build-utils/.builder/node_modules/@now-php/lib-73/native/php/modules/xsl.so (libexslt.so.0: cannot open shared object file: No such file or directory)) in Unknown on line 0

I tried to deploy Lumen(not Laravel) on now.sh and everything went well. If anyone knows the solution, please reply.

@CraftLogan
Copy link

@AGDholo could you post your now.json file. Thanks

@AGDholo
Copy link
Contributor

AGDholo commented Sep 16, 2019

@f3l1x
Copy link
Collaborator Author

f3l1x commented Oct 4, 2019

@f3l1x
Copy link
Collaborator Author

f3l1x commented Nov 20, 2020

Laravel example is included in https://github.com/juicyfx/vercel-examples

@rakitin3201
Copy link

rakitin3201 commented Mar 10, 2023

I got this error when i try to log into my vercel laravel project at https://ugeb.vercel.app/login :

Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#54 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#57 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#58 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#59 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#60 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#61 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#62 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#63 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#64 /var/task/user/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#66 /var/task/user/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#67 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#68 /var/task/user/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#69 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#70 /var/task/user/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#71 /var/task/user/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#72 /var/task/user/api/index.php(2): require('/var/task/user/...')
#73 {main}
"}

🐘STDERR: [Fri Mar 10 17:32:19 2023] 127.0.0.1:39112 Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants