Open wnsite opened 2 months ago
Fixed! Changed the json to:
{
"functions": {
"api/index.php": {
"runtime": "vercel-php@0.7.1"
}
},
"routes": [
{ "src": "/(.*)", "dest": "/api/index.php" }
]
}
sorry, but where is the different
got same error but above does not work.
Same error here
I was able to deploy the basic examples by setting Node.js version to 18.x on Vercel's project settings, I've tried vercel-php@0.7.1
, vercel-php@0.6.2
and vercel-php@0.5.5
with it and it seems fine.
I had the same error PHP Built-In Server HTTP error: Error: connect ECONNREFUSED 127.0.0.1:8000
when using the default version (Node.js 20.x).
The same just want to write comment. Node 18 will work.
Hi folks. Node 20.x seems to be problem. I need to investigate it.
i get error my web : https://doodplay.vercel.app/ my vercel id : QuBwX4iGVFwYPpmEJApy8H3L
how to fix it
I had the same problem with node 20x. I created package.json file and add this code to use node 18x version.
package.json
{ "engines": { "node": "18.x" } }
The project is running without any issue
I had the same problem. How can I fix it?
I managed to get it working by changing the Node.js Version in the Settings -> General on Vercel web page.
Did anyone find the solution I am facing the same error.
My file structure is as follows
and my vercel.json file is
I know I haven't defined the routes for all the api's but the index route is also not working.
Are you using Node 18.x? Node 20.x is a problem.
Are you using Node 18.x? Node 20.x is a problem.
yeah i have made that change
this solution works! thanks
I had the same problem with node 20x. I created package.json file and add this code to use node 18x version.
package.json
{ "engines": { "node": "18.x" } }
The project is running without any issue
I know Vercel uses Node.js to build our project and for the creation of Serverless Functions but I didn't quite understand the role of "runtime":"vercel-php@0.7.1"
An explanation would be greatly appreciated. Thank you
vercel.json-
{
"functions": {
"api/index.php": {
"runtime": "vercel-php@0.7.1"
}
},
"routes": [
{ "src": "/(.*)", "dest": "/api/index.php" }
]
}
package.json-
{ "engines": { "node": "18.x" } }
The error is:
Spawning: PHP Built-In Server at /var/task/user (document root) and /var/task/user/api/index.php (router)
🐘STDERR: php: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
Node 20x image has no libssl.so.10
The error is:
Spawning: PHP Built-In Server at /var/task/user (document root) and /var/task/user/api/index.php (router) 🐘STDERR: php: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
Node 20x image has no libssl.so.10
I have seen that the Node.js 18 will be retired on Vercel next year (Early 2025).
By the way, how important is libsssl.so in PHP? (I am just a beginner in PHP)
https://vercel.com/docs/functions/runtimes/node-js#node.js-version
Hey, I was testing this package and I set up the example and I got this error: PHP Built-In Server HTTP error: Error: connect ECONNREFUSED 127.0.0.1:8000. The vercel deployed but when I visit the website it shows that error. NOTE: I deployed it all using GitHub and vercel online, I did not install Node.JS or the Vercel CLI on my local machine. Do I need to do that? The site if you want to see for yourself: https://testvercelphp.vercel.app/ My test file structure: vercel.json api/ ├─ index.php
vercel.json: { "functions": { "api/index.php": { "runtime": "vercel-php@0.7.1" } }, "routes": [ { "src": "/(.*)", "dest": "/api/index.php" } ] }
index.php: <?php declare(strict_types = 1);
phpinfo(INFO_ALL & ~INFO_ENVIRONMENT & ~INFO_CONFIGURATION & ~INFO_VARIABLES);