juicyfx / vercel-examples Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Example projects using Vercel platform. Using Node.js, PHP and others.
Home Page: https://f3l1x.io
License: MIT License
๐ฆ Example projects using Vercel platform. Using Node.js, PHP and others.
Home Page: https://f3l1x.io
License: MIT License
When i try to deploy my laravel v10 application im getting this error
Error: The Serverless Function "api/index.php" is 327.89mb which exceeds the maximum size limit of 300mb. Learn More: https://vercel.link/serverless-function-size
is there any way/trick to fix it?
moved from: vercel-community/php#415
I try to start new symfony project. I found an example: https://github.com/juicyfx/vercel-examples/tree/master/php-symfony-micro1
But it seems to be outdated, and then I took laravel as a base for vercel.json - https://github.com/juicyfx/vercel-examples/tree/master/php-laravel
It builds and deployed to vercel, but unfortunately there is some problem with composer files. Actual I tried both configs, and resulting one is added in that commit: nosovk/symfony-vite@dd83860
But anyway it seems that autoload.php somehow broken.
Could we update the name of this repo to vercel-php-examples?
And could you please remove ZEIT Now from the description? ๐ Thank you!
https://github.com/xlenco/Vercel-Typecho
install: examples.com/install.php
I have server like "api.xxx.dev/backend/..." I have changed prefix backend to api
New path is "api.xxx.dev/api/.."
It is not working on development server getting 404 response code
but If I am using "api.xxx.dev/index.php/api/.." It is working on server
and I need to remove index.php from url
My Routeserviceprovide is
Route::middleware('api')
->prefix('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
And my .htaccess file is
Options -MultiViews -IndexesRewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index.php/(.+) /$1 [R=301,L]
Is there any required thing to do on vercel?
Fatal error: Uncaught RuntimeException: Unable to create the "cache" directory (/var/task/user/var/cache/prod). in /var/task/user/vendor/symfony/http-kernel/Kernel.php:623 Stack trace: #0 /var/task/user/vendor/symfony/http-kernel/Kernel.php(532): Symfony\Component\HttpKernel\Kernel->buildContainer() #1 /var/task/user/vendor/symfony/http-kernel/Kernel.php(131): Symfony\Component\HttpKernel\Kernel->initializeContainer() #2 /var/task/user/vendor/symfony/http-kernel/Kernel.php(191): Symfony\Component\HttpKernel\Kernel->boot() #3 /var/task/user/public/index.php(28): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #4 /var/task/user/api/index.php(3): require('/var/task/user/...') #5 {main} thrown in /var/task/user/vendor/symfony/http-kernel/Kernel.php on line 623
Tried to deploy the laravel example, using the button on the right in the table.
Do not change any settings during deployment.
Get a page with html, but the css and js cant be loaded by vercel it gets a laravel 404 when trying to load them.
Would expect a html, css and js to be loaded.
file_put_contents(/tmp/views/0f90093f751a3f4d993fa01cf5fee7b3bb0734ca.php): failed to open stream: No such file or directory
I'm unsure if blades in general aren't supported, but I'm trying to have blades compile instead of using a SPA. Here's my now.json conifg:
{
"version": 2,
"functions": {
"api/index.php": {
"runtime": "[email protected]"
}
},
"routes": [
{
"src": "/(.*)",
"dest": "/api/index.php"
}
],
"env": {
"APP_NAME": "Vercel Laravel",
"APP_KEY": "REDACTED",
"APP_ENV": "local",
"APP_DEBUG": "true",
"APP_URL": "https://php-laravel.vercel.app",
"VERCEL_DEMO_MODE": "true",
"APP_CONFIG_CACHE": "/tmp/config.php",
"APP_EVENTS_CACHE": "/tmp/events.php",
"APP_PACKAGES_CACHE": "/tmp/packages.php",
"APP_ROUTES_CACHE": "/tmp/routes.php",
"APP_SERVICES_CACHE": "/tmp/services.php",
"CACHE_DRIVER": "array",
"LOG_CHANNEL": "stderr",
"SESSION_DRIVER": "array",
"VIEW_COMPILED_PATH": "/tmp/views",
"SSR_TEMP_PATH": "/tmp/ssr",
"NODE_PATH": "node"
}
}
I set the DB drive config to sqlite
,
.env
:
DB_CONNECTION=sqlite
DB_DATABASE=D:\repo\php-laravel\database\database.sqlite
or
now.json
:
"DB_CONNECTION": "sqlite",
"DB_DATABASE": "D:\repo\php-laravel\database\database.sqlite"
But the console told me the warning when I use the php artisan migrate
command:
Illuminate\Database\QueryException
could not find driver (SQL: select * from information_schema.tables where table_schema = forge and
table_name = migrations and table_type = 'BASE TABLE')
I can use sqlite as a database in a brand new laravel application.
Can upload or pull a example with codeigniter 4 ?
or the same example of codeigniter 3 work with codeigniter 4??
Thank you
Hello, I encounter a problem with API Platform and Vercel, I tried many things and nothing seems to work.
What I have :
api
folder created to allow serverless function on Vercel (the index.php
file contains the exact same thing as the public/index.php
file)vercel.json
with the following content :{
"functions": {
"api/index.php": {
"runtime": "[email protected]"
}
},
"routes": [
{ "src": "/bundles/(.*)", "dest": "/public/bundles/$1" },
{ "src": "/(.*)", "dest": "/api/index.php" },
{ "src": "/api/(.*)", "dest": "/api/index.php" }
],
"env": {
"APP_ENV": "dev",
"APP_SECRET": "b2b9b5f9ae35ad900c9c25605e210aad"
}
}
When I try to access SwaggerUI (on myurl.vercel.app/api
, it's kinda working (no assets but I know why and won't fix it since SwaggerUI won't go in production), but when I try to request the API, it just returns No route found
.
I don't know what I'm doing wrong, but it's driving me crazy. Can you help me please ?
Thanks !
Hi what do I have to do to deploy my existing project on vercel?
Running into the above error. Steps to reproduce:
This is my first time using Vercel, sorry if I am missing something basic.
Here is the full output from Vercel
[13:58:13.793] Cloning github.com/***************************** (Branch: *************, Commit: *******)
[13:58:16.783] Cloning completed: 2.990s
[13:58:16.938] Restored build cache
[13:58:16.993] Running "vercel build"
[13:58:17.592] Vercel CLI 28.12.7
[13:58:17.782] > Installing Builder: [email protected]
[13:58:21.951] ๐ Downloading user files
[13:58:21.952] ๐ Downloading PHP runtime files
[13:58:21.971] ๐ Creating lambda
[13:58:22.367] Build Completed in /vercel/output [420ms]
[13:58:28.894] Failed to process build result for "api/index". Data: {"type":"Lambda"}.
[13:58:28.897] Error: The Serverless Function "api/index" is 68.16mb which exceeds the maximum size limit of 50mb. Learn More: https://vercel.link/serverless-function-size
We need to update the PHP version used in our project to "[email protected]" to take advantage of the latest improvements and bug fixes. This change is essential for maintaining the performance and security of our application.
The application in vercel should continue to function correctly with the updated PHP version, and we should see improvements in performance and stability.
Any specific considerations or dependencies related to this PHP version update.
Any potential risks or issues that need to be addressed during the update.
Any relevant documentation or links.
I need to execute php artisan migrate
command after the dependencies have been installed.
I've tried using composer scripts but it doesn't seem to work properly.
I'm using vercel's postgresql database and I've already set the credentials in the environment variables.
Is there any way to execute artisan command?
"Error: EISDIR: illegal operation on a directory, read" is showing on the vercel logs when trying it on a fresh laravel installation, it happens both with the vercel cli, and with git commit
I have a small project, while deploy, it shows:
Build Failed
The Serverless Function "api/index.php" is 56.31mb which exceeds the maximum size limit of 50mb.
https://vercel.com/docs/concepts/limits/overview#serverless-function-size
How to use Cache::set('key', 'test'); with CACHE_DRIVER=file?
I change to /tmp/ , no errors, but the cache function seems not work. each trigger always fetch from DB.
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
==>
'file' => [
'driver' => 'file',
'path' => '/tmp/framework/cache/data',
],
thanks.
How can i access vercel environment variables in my php files?
Redirect constantly between http://wordpress-alpha.vercel.app/wp-admin/install.php and https://wordpress-alpha.vercel.app/wp-admin/install.php
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.