Title: Add support for BOM-signed env files · Issue #500 · phpdotenv/phpdotenv · GitHub
Open Graph Title: Add support for BOM-signed env files · Issue #500 · phpdotenv/phpdotenv
X Title: Add support for BOM-signed env files · Issue #500 · phpdotenv/phpdotenv
Description: Hi! I was working on a Laravel project that has a .env file. But I faced an error that says: The environment file is invalid! Failed to parse dotenv file due to an invalid name. Failed at [APP_NAME]. After some time for debugging, I rea...
Open Graph Description: Hi! I was working on a Laravel project that has a .env file. But I faced an error that says: The environment file is invalid! Failed to parse dotenv file due to an invalid name. Failed at [APP_NAM...
X Description: Hi! I was working on a Laravel project that has a .env file. But I faced an error that says: The environment file is invalid! Failed to parse dotenv file due to an invalid name. Failed at [APP_NAM...
Opengraph URL: https://github.com/phpdotenv/phpdotenv/issues/500
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add support for BOM-signed env files","articleBody":"Hi!\r\nI was working on a Laravel project that has a .env file.\r\nBut I faced an error that says:\r\n`The environment file is invalid!`\r\n`Failed to parse dotenv file due to an invalid name. Failed at [APP_NAME].`\r\n\r\nAfter some time for debugging, I realized the problem is come from encoding of the file!\r\nThe encoding of the .env file is [UTF8 BOM](https://en.wikipedia.org/wiki/Byte_order_mark)\r\n\r\nIn this [example files](https://github.com/hosni/tmp/tree/master/github.com/vlucas/phpdotenv/add-support-for-BOM-signed-env-files) you will see two files named `.env-UTF-8` and `.env-UTF-8-with-BOM`. They almost contains the same data, but `.env-UTF-8-with-BOM` starts with the UTF8 BOM, causing the parse error.\r\n\r\n\r\n\r\n\r\n\r\n### How did happen?\r\nI'm using linux as OS, but well it seems that when you add a text file in Visual Studio in windows, it adds the UTF8 BOM by default. I generated the second file that has to BOM using the Windows Explorer contextual menu \"New File\".","author":{"url":"https://github.com/hosni","@type":"Person","name":"hosni"},"datePublished":"2021-11-08T15:35:15Z","url":"https://github.com/phpdotenv/phpdotenv/issues/500"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a6dbc13a-b298-2b88-64a9-4766710dffb7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80B2:12B33:297AB14:374207F:6B06BA9A |
| html-safe-nonce | a74d059fd75a40233518fcc2b9cde57f84097a6edfeb60cf5589a70d4ec1f0a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MEIyOjEyQjMzOjI5N0FCMTQ6Mzc0MjA3Rjo2QjA2QkE5QSIsInZpc2l0b3JfaWQiOiI1OTU1MjI0NTAzMTg4NjcwOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d208a6ab904d50447bc32fed21a4fc157e370b71450743ccc7a8ecd5e630470d |
| hovercard-subject-tag | issue:1047595835 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpdotenv/phpdotenv/500/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ad12469a5474b6f1d88f0967b05411d5554ce363cbd03befe657fe827660487/phpdotenv/phpdotenv/issues/500 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ad12469a5474b6f1d88f0967b05411d5554ce363cbd03befe657fe827660487/phpdotenv/phpdotenv/issues/500 |
| og:image:alt | Hi! I was working on a Laravel project that has a .env file. But I faced an error that says: The environment file is invalid! Failed to parse dotenv file due to an invalid name. Failed at [APP_NAM... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hosni |
| hostname | github.com |
| expected-hostname | github.com |
| None | 32031aaff792fa7ad778f7418e1fbfc0d525a5779804329b769aa75230448a18 |
| turbo-cache-control | no-preview |
| go-import | github.com/phpdotenv/phpdotenv git https://github.com/phpdotenv/phpdotenv.git |
| octolytics-dimension-user_id | 320763234 |
| octolytics-dimension-user_login | phpdotenv |
| octolytics-dimension-repository_id | 7769432 |
| octolytics-dimension-repository_nwo | phpdotenv/phpdotenv |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7769432 |
| octolytics-dimension-repository_network_root_nwo | phpdotenv/phpdotenv |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 37014d914b7d14eede971655595f687a0202af40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width