Search code examples
phplaravellaravel-5.1ovh

Laravel 5.1 and ovh Issue


My host is the type pro (OVH) I have a problem with laravel 5.1 in Ovh when I type php artisan I get

X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Warning</b>:  Unexpected character in input:  '\' (ASCII=92) state=1 in <b>/home/obliviushc/petite-enfance/artisan</b> on line <b>31</b><br />
<br />
<b>Parse error</b>:  syntax error, unexpected T_STRING in <b>/home/obliviushc/petite-enfance/artisan</b> on line <b>31</b><br />

and as you see the version of php is 4.4.9 and i followed the instructions from the site of OVH to change the version of php and i added .ovhconfig in public/ file and it contains these lines

app.engine=php
app.engine.version=5.6
http.firewall=none
environment=production

and i tested inside a view file with <?php phpinfo() ?> and I get 5.6.15 now is this due to the php of version or what ? please help me I'm Stuck!


Solution

  • As per the documentation, the minimum PHP version required is: PHP >= 5.5.9.

    It seems the command line is still pointing to the old PHP version, so artisan fails. In order to get the correct path, find where your php is installed, add a script and run it from the browser (i.e. handled by Apache)

    <?php
    echo PHP_BINDIR;
    

    Then add that directory to your PATH variable.

    Finally try to remove the old PHP version path, you can find it by running this command in CLI:

    which php