<p>I forgot to add that i use <a href="https://github.com/nystudio107/craft-multi-environment" rel="nofollow noreferrer">https://github.com/nystudio107/craft-multi-environment</a> as a flexible multi-environment config for Craft CMS.</p>

<p>I managed to fix the issue setting two variables to the linked valet url in the public/index.php:</p>

<pre><code>$_SERVER['PHP_SELF'] = 'valeturl.dev';
$_SERVER['SCRIPT_NAME'] = 'valeturl.dev';
</code></pre>

<p>now all the updates etc work as expected. </p>

CC BY-SA 3.0
2017-03-11T21:43:33.193Z
2017-03-11T22:29:38.883Z
2017-03-11T22:29:38.883Z
HendrikEng
<p>I ran into an issue updating Craft and Craft Commerce in my development environment.</p>

<p>I am using Laravel Valet. As soon as I want to update (tried manual as well) Craft will throw the error :</p>

<pre><code>Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.
Please talk to your host/IT department about upgrading your server.
</code></pre>

<p>The Error in the logs is: </p>

<pre><code>2017/03/09 16:11:10 [error] [exception.Craft\HttpException.400] Craft\HttpException in /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/controllers/BaseController.php:217
    Stack trace: -0 /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/controllers/UpdateController.php(192): Craft\BaseController-&gt;requireAjaxRequest() -1 /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/framework/web/actions/CInlineAction.php(49): Craft\UpdateController-&gt;actionPrepare()
</code></pre>

<p>I already figured that setting <code>$_SERVER['PHP_SELF']</code> to the same value as <code>$_SERVER['SCRIPT_NAME']</code> would solve the issue, but I cant make it work somehowe... I am sure I am missing something, my project folder structure is:</p>

<pre><code>App
|-- dist
|   |-- craft
|   `-- public
`-- src
    `-- index.php
</code></pre>

<p>And this is the Valet CraftMultiLocaleValetDriver.php I am using:</p>

<pre><code>&lt;?php

class CraftMultiLocaleValetDriver extends ValetDriver
{
    /**
     * Determine if the driver serves the request.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return bool
     */
    public function serves($sitePath, $siteName, $uri)
    {
        return is_dir($sitePath.'/craft');
    }

    /**
     * Determine if the incoming request is for a static file.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string|false
     */
    public function isStaticFile($sitePath, $siteName, $uri)
    {
        if ($this-&gt;isActualFile($staticFilePath = $sitePath.'/public'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }

    /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string
     */
    public function frontControllerPath($sitePath, $siteName, $uri)
    {
        // Default index path
        $indexPath = $sitePath.'/src/index.php';
        $scriptName = '/index.php';

        // Check if the first URL segment matches any of the defined locales
        $locales = [
            'ar',
            'ar_sa',
            'bg',
            'bg_bg',
            'ca_es',
            'cs',
            'cy_gb',
            'da',
            'da_dk',
            'de',
            'de_at',
            'de_ch',
            'de_de',
            'el',
            'el_gr',
            'en',
            'en_as',
            'en_au',
            'en_bb',
            'en_be',
            'en_bm',
            'en_bw',
            'en_bz',
            'en_ca',
            'en_dsrt',
            'en_dsrt_us',
            'en_gb',
            'en_gu',
            'en_gy',
            'en_hk',
            'en_ie',
            'en_in',
            'en_jm',
            'en_mh',
            'en_mp',
            'en_mt',
            'en_mu',
            'en_na',
            'en_nz',
            'en_ph',
            'en_pk',
            'en_sg',
            'en_shaw',
            'en_tt',
            'en_um',
            'en_us',
            'en_us_posix',
            'en_vi',
            'en_za',
            'en_zw',
            'en_zz',
            'es',
            'es_cl',
            'es_es',
            'es_mx',
            'es_us',
            'es_ve',
            'et',
            'fi',
            'fi_fi',
            'fil',
            'fr',
            'fr_be',
            'fr_ca',
            'fr_ch',
            'fr_fr',
            'fr_ma',
            'he',
            'hr',
            'hr_hr',
            'hu',
            'hu_hu',
            'id',
            'id_id',
            'it',
            'it_ch',
            'it_it',
            'ja',
            'ja_jp',
            'ko',
            'ko_kr',
            'lt',
            'lv',
            'ms',
            'ms_my',
            'nb',
            'nb_no',
            'nl',
            'nl_be',
            'nl_nl',
            'nn',
            'nn_no',
            'no',
            'pl',
            'pl_pl',
            'pt',
            'pt_br',
            'pt_pt',
            'ro',
            'ro_ro',
            'ru',
            'ru_ru',
            'sk',
            'sl',
            'sr',
            'sv',
            'sv_se',
            'th',
            'th_th',
            'tr',
            'tr_tr',
            'uk',
            'vi',
            'zh',
            'zh_cn',
            'zh_tw',
        ];
        $parts = explode('/', $uri);

        if (count($parts) &gt; 1 &amp;&amp; in_array($parts[1], $locales)) {
            $indexPath = $sitePath.'/src/'. $parts[1] .'/index.php';
            $scriptName = '/' . $parts[1] . '/index.php';
        }

        $_SERVER['SCRIPT_FILENAME'] = $indexPath;
        $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
        $_SERVER['SCRIPT_NAME'] = $scriptName;

        return $indexPath;
    }
}
</code></pre>

<p>I just put it in the .Valet/drivers/ folder and restarted Valet, what am i missing, how can i check of the path is set right?</p>

<p>Thanks a lot. </p>

<control-panel><database><updates><valet>
Updating Craft in Laravel Valet dev enviornment
# Updating Craft in Laravel Valet dev enviornment

(Asked by: username_0 on 2017-03-11)

I ran into an issue updating Craft and Craft Commerce in my development environment.
I am using Laravel Valet. As soon as I want to update (tried manual as well) Craft will throw the error :
Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.
Please talk to your host/IT department about upgrading your server.

The Error in the logs is: 
2017/03/09 16:11:10 [error] [exception.Craft\HttpException.400] Craft\HttpException in /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/controllers/BaseController.php:217
    Stack trace: -0 /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/controllers/UpdateController.php(192): Craft\BaseController->requireAjaxRequest() -1 /Users/hendrik/Documents/Github/Projects/app/dist/craft/app/framework/web/actions/CInlineAction.php(49): Craft\UpdateController->actionPrepare()

I already figured that setting $_SERVER['PHP_SELF'] to the same value as $_SERVER['SCRIPT_NAME'] would solve the issue, but I cant make it work somehowe... I am sure I am missing something, my project folder structure is:
App
|-- dist
|   |-- craft
|   `-- public
`-- src
    `-- index.php

And this is the Valet CraftMultiLocaleValetDriver.php I am using:
isActualFile($staticFilePath = $sitePath.'/public'.$uri)) {
            return $staticFilePath;
        }

        return false;
    }

    /**
     * Get the fully resolved path to the application's front controller.
     *
     * @param  string  $sitePath
     * @param  string  $siteName
     * @param  string  $uri
     * @return string
     */
    public function frontControllerPath($sitePath, $siteName, $uri)
    {
        // Default index path
        $indexPath = $sitePath.'/src/index.php';
        $scriptName = '/index.php';

        // Check if the first URL segment matches any of the defined locales
        $locales = [
            'ar',
            'ar_sa',
            'bg',
            'bg_bg',
            'ca_es',
            'cs',
            'cy_gb',
            'da',
            'da_dk',
            'de',
            'de_at',
            'de_ch',
            'de_de',
            'el',
            'el_gr',
            'en',
            'en_as',
            'en_au',
            'en_bb',
            'en_be',
            'en_bm',
            'en_bw',
            'en_bz',
            'en_ca',
            'en_dsrt',
            'en_dsrt_us',
            'en_gb',
            'en_gu',
            'en_gy',
            'en_hk',
            'en_ie',
            'en_in',
            'en_jm',
            'en_mh',
            'en_mp',
            'en_mt',
            'en_mu',
            'en_na',
            'en_nz',
            'en_ph',
            'en_pk',
            'en_sg',
            'en_shaw',
            'en_tt',
            'en_um',
            'en_us',
            'en_us_posix',
            'en_vi',
            'en_za',
            'en_zw',
            'en_zz',
            'es',
            'es_cl',
            'es_es',
            'es_mx',
            'es_us',
            'es_ve',
            'et',
            'fi',
            'fi_fi',
            'fil',
            'fr',
            'fr_be',
            'fr_ca',
            'fr_ch',
            'fr_fr',
            'fr_ma',
            'he',
            'hr',
            'hr_hr',
            'hu',
            'hu_hu',
            'id',
            'id_id',
            'it',
            'it_ch',
            'it_it',
            'ja',
            'ja_jp',
            'ko',
            'ko_kr',
            'lt',
            'lv',
            'ms',
            'ms_my',
            'nb',
            'nb_no',
            'nl',
            'nl_be',
            'nl_nl',
            'nn',
            'nn_no',
            'no',
            'pl',
            'pl_pl',
            'pt',
            'pt_br',
            'pt_pt',
            'ro',
            'ro_ro',
            'ru',
            'ru_ru',
            'sk',
            'sl',
            'sr',
            'sv',
            'sv_se',
            'th',
            'th_th',
            'tr',
            'tr_tr',
            'uk',
            'vi',
            'zh',
            'zh_cn',
            'zh_tw',
        ];
        $parts = explode('/', $uri);

        if (count($parts) > 1 && in_array($parts[1], $locales)) {
            $indexPath = $sitePath.'/src/'. $parts[1] .'/index.php';
            $scriptName = '/' . $parts[1] . '/index.php';
        }

        $_SERVER['SCRIPT_FILENAME'] = $indexPath;
        $_SERVER['SERVER_NAME'] = $_SERVER['HTTP_HOST'];
        $_SERVER['SCRIPT_NAME'] = $scriptName;

        return $indexPath;
    }
}

I just put it in the .Valet/drivers/ folder and restarted Valet, what am i missing, how can i check of the path is set right?
Thanks a lot.

**Tags:** control-panel, database, updates, valet


---

## 1 answers

### Answer by username_0 on 2017-03-11. Score: 1 | Accepted answer

I forgot to add that i use https://github.com/nystudio107/craft-multi-environment as a flexible multi-environment config for Craft CMS.
I managed to fix the issue setting two variables to the linked valet url in the public/index.php:
$_SERVER['PHP_SELF'] = 'valeturl.dev';
$_SERVER['SCRIPT_NAME'] = 'valeturl.dev';

now all the updates etc work as expected.


---

