<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Laravel 5 - env() always returns null]]></title><description><![CDATA[<p dir="auto">来源：<a href="https://stackoverflow.com/questions/43243732/laravel-5-env-always-returns-null" rel="nofollow ugc">https://stackoverflow.com/questions/43243732/laravel-5-env-always-returns-null</a><br />
env file：</p>
<pre><code>APP_ENV=production
APP_KEY=base64:mymagickey=
APP_DEBUG=false
APP_LOG_LEVEL=info
APP_URL=http://www.example.com
</code></pre>
<p dir="auto">get env</p>
<pre><code>print(env('APP_LOG_LEVEL'))

null
</code></pre>
<p dir="auto">解决方案（项目目录下执行）：</p>
<pre><code>php artisan config:clear
</code></pre>
]]></description><link>http://an.forum.genostack.com/topic/770/laravel-5-env-always-returns-null</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 09:20:52 GMT</lastBuildDate><atom:link href="http://an.forum.genostack.com/topic/770.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Oct 2022 02:42:56 GMT</pubDate><ttl>60</ttl></channel></rss>