2

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!

khaleader
  • 183
  • 2
  • 15

2 Answers2

1

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
Mina Abadir
  • 2,951
  • 2
  • 15
  • 20
  • I successfully added php 5.6 of the new path but when I try to remove the old path i get can't delete read only – khaleader Dec 08 '15 at 14:40
  • how do you try to remove it, also what is the output of `php -v` now? – Mina Abadir Dec 08 '15 at 14:41
  • I did rm /usr/local/bin/php to remove ,, the output is still PHP 4.4.9 (cgi) (built: Apr 20 2012 18:34:17) Copyright (c) 1997-2008 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies – khaleader Dec 08 '15 at 14:44
  • This is not the right way, just add the new directory to the beginning of your PATH variable, so it's searched first. – Mina Abadir Dec 08 '15 at 14:45
  • You are the hero Man it worked Thank you , but there is a little problem when I close Putty and enter again I find that the new path is deleted , how to save it ? – khaleader Dec 08 '15 at 15:04
  • You need to add it to your `.bashrc` file. – Mina Abadir Dec 08 '15 at 15:10
1
php5.5 -v

if ok then use 'php5.5' instead of 'php' in every commands :

curl -sS https://getcomposer.org/installer | php5.5
php5.5 composer.phar install
php5.5 artisan clear-compiled
php5.5 artisan optimize