更改Laravel的URL时出现base64_decode()异常

时间:2014-06-20 17:21:21

标签: php url laravel virtualhost

我在位于/var/www/html/site/的服务器上安装了laravel,我可以在dev.site.com访问它。我想通过更改该虚拟主机的文档根目录,将主板网址更改为site.com。所以我将site.com指向/var/www/html/site/public并且laravel给出了错误:

base64_decode() expects parameter 1 to be a string, array given

只有在我使用网址site.com访问网站时才会发生这种情况,当我将其更改回dev.site.com时,再次没问题。我已将应用程序网址更新为site.com

我在centos 4.5 final上运行了laravel 4.2。


虚拟主机

<VirtualHost *:80>
    ServerName dev.site.com
    ServerAlias dev.site.com
    ServerAdmin tech@myDomain.com
    DocumentRoot "/var/www/html/site/public"
    <Directory /var/www/html/site/public>
            AllowOverride All
            Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName site.com
    ServerAlias site.com
    ServerAdmin tech@myDomain.com
    DocumentRoot "/var/www/html/site/public"
    <Directory /var/www/html/site/public>
            AllowOverride All
            Allow from all
    </Directory>
</VirtualHost>

/var/www/html/site/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php

 * @param  string  $payload
 * @return array
 *
 * @throws DecryptException
 */
protected function getJsonPayload($payload)
{
    $payload = json_decode(base64_decode($payload), true);

7 Illuminate \ Encryption \ Encrypter getJsonPayload

 * Decrypt the given value.
 *
 * @param  string  $payload
 * @return string
 */
public function decrypt($payload)
{
    $payload = $this->getJsonPayload($payload);

    // We'll go ahead and remove the PKCS7 padding from the encrypted value before

再说一遍,如果我去dev.site.com再次没问题。

1 个答案:

答案 0 :(得分:1)

只需清理我的饼干即可解决....